saveBookmarks()

SaveBookmarks() saves all bookmarks of an ewo in the given context.

Synopsis

void saveBookmarks(string context);

Parameters

Parameter Meaning
context Specify a string where the bookmark is saved to.

Description

SaveBookmarks() saves all bookmarks of an ewo in the given context (string). These can be restored again by passing the same context string to the function restoreBookmarks().

Bookmarks are stored directly in the user settings file on the local disk. Therefore, you cannot restore bookmarks if you defined these on a different machine.

Example

  • Create a new panel and add two Script Editor EWOs (ScriptEdit1 and ScriptEdit2) as well as a button to the panel:
    Figure 1. Create a panel with Script Editor EWOS
  • Add two texts to the two Script Editors (ScriptEdit1 and ScriptEdit2).
    main()
    {
      ScriptEdit1.plainText = "Hello\nThis\nscript\nsets\nbookmarks";
      ScriptEdit2.plainText =  "Hello\nThis\nscript\nsets\nbookmarks";
    }            
  • Add a code to the button to save and restore bookmarks:
    main(mapping event)
    {
      ScriptEdit1.saveBookmarks("bookmarks");
      ScriptEdit2.restoreBookmarks("bookmarks");
    }
  • Save the panel and open it in a Vision module. Add bookmarks via CTRL+B and save and restore the bookmarks via the button.
    Figure 2. Save the panel and add, save and restore bookmarks

Assignment

The Script Editor

Availability

UI