runSelection

Syntax runSelection ()

Params None required.

Action Depends on the type of window that is frontmost:

In a menubar window, runs the script attached to the bar cursor

In a table window, runs the selected script or string

In an outline window, runs the selected headline

In a text window, runs the selected text as a string

Returns Result of the execution of the selection as a script.

Examples Open root.examples.docs and select the entry labeled "Basic1." It is a string containing: dialog.confirm ("Click OK to continue or Cancel to abort"). In the QuickScript Window, execute:
runSelection ()

   » true

Returns true regardless of your answer to the dialog, indicating that the command executed correctly.

Errors A variety of errors can be generated if the selection is not a valid Frontier script, depending on what is wrong with it.

Notes The Frontier Command-/ and ctrl-/ commands are implemented using runSelection.

If you execute runSelection in an outline structure, Frontier deposits the result of the execution as a comment immediately beneath the selected structure.

See Also evaluate

Discuss