Setting bookmarks via scripts

Ask questions about how to create a script or swap scripts with other users.
Post Reply
Lively
Posts: 3
Joined: 13 Sep 2011 13:02

Setting bookmarks via scripts

Post by Lively »

Hi,

Is there a way to add bookmarks, and using them later please?
It would be a kind of "MainApp.Addbookmark(lineNumber);" and "MainApp.Gotobookmark(bookmarkNumber);"


Thank you.
jgodfrey
Posts: 471
Joined: 19 Aug 2011 23:02
Location: Missouri, USA

Re: Setting bookmarks via scripts

Post by jgodfrey »

Would these bookmarks only be for use by the script itself (to remember specific locations in the file while the script is running) or would they be for interactive use by the User?

If they're just for script use, then I guess you don't really need a "bookmark" per se, but only a way to remember specific line and column positions. In that case, you could simply save the values returned by Document.CursorX and Document.CursorY along with some named "tag" for later reference (using maybe the WStrings object). If you wanted to persist that information for later, maybe you could use DSPL, here: http://www.rjsoftware.se/Forum/viewtopi ... =11&t=1968

On the other hand, if you want to insert a true "bookmark" for interactive use by the User, I don't think you can currently do that (though maybe Rickard could add appropriate methods to the scripting engine). However, unless I'm mistaken, I don't think bookmarks are currently saved with the document.

Jeff
Lively
Posts: 3
Joined: 13 Sep 2011 13:02

Re: Setting bookmarks via scripts

Post by Lively »

Thank you for your answer Jeff.
I would like to us them in interaction with the user, a script that puts bookmarks which can be deleted by the user.
Post Reply