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

scripts/png apply/png

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

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!
Optional comment

Other relevant pages

Top of page


Page Information

http://css.torrens.org/valid-html401-bluehttp://css.torrens.org/valid-css Document URI: http://stronged.torrens.org/man/features/scripts.html
Page first published 10th of February, 2020
Last modified:Mon, 08 Jul 2024 09:18:30 BST
© 2020 - 2024 Richard John Torrens.