Scripts
A script is essentially a program written in a language which Risc OS can run, which can be used to process the text loaded into a StrongED window. The Scripts icon allows you to apply these scripts to the text you are editing.
The most useful scripting language is Lua - because it is maintained and the maintainer writes lots of suitable scripts. You can also use a BASIC program. Also available are Python, Perl and others.
The supplied scripts are really examples of what can be done. Some are old, some not much use and some do not work. But some are very useful!
Scripts icon
- Select opens the Scripts directory (pointed to by StrongED$ScriptsDir) which will be either !StrongED.Defaults.Tools.!ScriptSED.Scripts or !StrED_cfg.UserPrefs.Tools.!ScriptsSED.Scripts.
- Ctrl-Drag a script here to apply it to the text, the result will displayed in a new window.
- Shift-Drag a script here to apply it to the text, the result will replace the current text.
- Ctrl-Shift-Drag a script here to apply it to all texts, the results will replace the current text.
- Adjust opens the Apply script dialog box.
Scripts can be anywhere if you wish to drag them to the Scripts icon but if you wish to run them from the Scripts icon then they must be in one of the Scripts directories as above. Note that !StrED_cfg as supplied does not contain the !ScriptsSED application so if you want to run scripts from !StrED_cfg you will need to move
!StrongED.Defaults.Tools.!ScriptSED into the !StrED_cfg.UserPrefs.Tools directory. Only one instance of !StrED_cfg is active. If you have it in !StrongED and in !StrED_cfg the second will be ignored
Languages
Of these languages, only BASIC is supplied installed as standard. Other languages must be installed from zip files, which may be supplied in the develop area of your computer's disc image. Otherwise they must be downloaded. They must be installed somewhere that they will be seen during Boot.
- Awk, gawk, mawk
- These are three different implementations of the same scripting language, Awk. A Risc OS implementation of Gawk is available from ROOL, but there are no instructions. However installation is simple:-
- Download it
- Change its file type to ff8 (Absolute)
- Rename it to awk - if named gawk StrongED complains "awk not found"
- Move it to !Boot.Library
StrongED can now use it.
- BASIC
- BASIC is of course already installed and available
- Lua
- RiscLua is available from Gavin Wraith's www site. Gavin has written many Lua scripts and the web page has links to hints on scripting and using Lua, so this is the most useful language. Other scripts may be available - ask via the Mailing List. RiscLua may be supplied in the develop directory of your computer's disk. It is also available via !Store.
- Perl
- A Risc OS port of Perl is available from Chris Gransden's Risc OS Ports Download site. This may be supplied in the develop directory of your computer's disk
- Python
- Python may be supplied in the develop directory of your computer's disk. A Risc OS port of Python is available from Chris Gransden's Risc OS Port Download site. However to use this the contents of the file !StrongED.Defaults.Tools.!ScriptSED.Languages.python must be changed to call python 27 and not just python.
- sed
- A Risc OS implementation may not be available. Let me know if you can help.
- StrongED
- StrongED's own functions can be used, but this feature is not yet completed. It should be available in a soon-to-be released issue.
Scripts supplied
- Awk, gawk, mawk
The Awk scripts supplied with StrongED are not well commented. Gavin Wraith has supplied a new zip of Awk scripts as below.
- condens
- remove linefeeds from paragraphs. This can be useful for transferring formatted text to a program such as OvationPro which does its own formatting
- include
- An attempt to mimic C's #include directive.
- listunique
- list non duplicate lines
- nodup
- no duplicate lines
- nodup2
- no duplicate lines
- number
- Number non-empty lines
- number2
- Number all lines
- URLgrab
- extract links from a webpage. Does not extract local links, only those starting http.
- wordfreq
- list non duplicate lines
- BASIC
- LineNumber
- LineNumber2
- LineNumber3
- Lua
- ab
- Blup
- bracket
- dedupe
- MailStrip
- markup
- MultipleS+R
- number
- number1
- number2
- Roman
- RomNum
- StripDocx
- sumnums
-
- Perl
- Python
- Number
-
-
- Number2
-
- This crashes!
- sed
Was this page helpful? Please email me and/or rate this page:
If you want a reply make sure any email address @torrens.org will not get spam-binned!