StrongED:Applying scripts: Difference between revisions

From RISC OS
Jump to navigationJump to search
Line 2: Line 2:


[[Image:apply26x26.gif]]
[[Image:apply26x26.gif]]

In the toolbar of versions of StrongED from 4.67 onwards you will see this icon. Its purpose is to let you ''apply'' a script to the text in the window. If you '''shift-drag''' the icon of the script file onto the apply icon the action of the script will be applied to the contents of the window. If you '''ctrl-drag''' the icon of the script file onto the apply icon then the result will be displayed in a new StrongED window; the original window will be unchanged. If you '''shift-ctrl-drag''' the icon of the script file onto the apply icon the action of the script will be applied to all the open StrongED windows; this can be useful for mailshots.
In the toolbar of versions of StrongED from 4.67 onwards you will see this icon. Its purpose is to let you ''apply'' a script to the text in the window. If you '''shift-drag''' the icon of the script file onto the apply icon the action of the script will be applied to the contents of the window. If you '''ctrl-drag''' the icon of the script file onto the apply icon then the result will be displayed in a new StrongED window; the original window will be unchanged. If you '''shift-ctrl-drag''' the icon of the script file onto the apply icon the action of the script will be applied to all the open StrongED windows; this can be useful for mailshots.

The mechanism for achieving this has evolved with the different versions of StrongED, but for version 4.68a4 it is achieved by the application '''!ScriptSED''' in the !StrongED.Defaults.Tools directory. For a generic scripting language ''foo'', foo-scripts should begin with the line

<font color="green">#! foo</font>

the foo binary should be on your system's Run$Path and an Obey file called '''foo''' should be put in the !ScriptSED.Languages directory telling StrongED how to apply the script. Its syntax will depend on foo's requirements for a correct commandline. The languages
* awk
* basic
* lua
* perl
* python
are already provided with appropriate Obey files, and their contents should be sufficient to enable a foo-enthusiast to get foo working with StrongED.

Revision as of 10:34, 11 May 2008

Applying scripts to StrongED windows

Apply26x26.gif In the toolbar of versions of StrongED from 4.67 onwards you will see this icon. Its purpose is to let you apply a script to the text in the window. If you shift-drag the icon of the script file onto the apply icon the action of the script will be applied to the contents of the window. If you ctrl-drag the icon of the script file onto the apply icon then the result will be displayed in a new StrongED window; the original window will be unchanged. If you shift-ctrl-drag the icon of the script file onto the apply icon the action of the script will be applied to all the open StrongED windows; this can be useful for mailshots.

The mechanism for achieving this has evolved with the different versions of StrongED, but for version 4.68a4 it is achieved by the application !ScriptSED in the !StrongED.Defaults.Tools directory. For a generic scripting language foo, foo-scripts should begin with the line

#! foo

the foo binary should be on your system's Run$Path and an Obey file called foo should be put in the !ScriptSED.Languages directory telling StrongED how to apply the script. Its syntax will depend on foo's requirements for a correct commandline. The languages

  • awk
  • basic
  • lua
  • perl
  • python

are already provided with appropriate Obey files, and their contents should be sufficient to enable a foo-enthusiast to get foo working with StrongED.