that, I currently don’t know how to accomplish.

It looks like it would require the plugin value GET_LINE_INFO
to know whether the line has changed since before you pressed “F2”. And I don’t see how the javascript and plugin structure relate to one another.

Nor do I see how one can easily assign a shortcut-key to a macro, so that it will automatically run without user-intervention.

Now with Autohotkey, I have an idea how it could be done. Monitor object changed when F2 is pressed. If the object hasn’t changed then goto beginning of document (Ctrl+Home) and unhook the RegisterCallBack for object changed.