Events are quite similar to aliases. At the simplest level, events need a name and a script, just like aliases. Unlike aliases, events aren't triggered by typing their name on the command line or as a command in a script.
Events are raised with the #RAISEEVENT command. TeSSH also includes some Predefined Events that it will raise when certain things occur.
Events can be viewed by clicking the Settings button on the main toolbar and then clicking the Show Events filter button on the far left of the Package Editor. To edit an event, just click its name and the details will be displayed in the right half of the window. To create a new event, click the New button at the top of the Editor and choose New Event.The Editing Events topic has more info on using the Package editor to edit events.
You can also use the #EVENT to define an event from the TeSSH command line.
defines a new event. Events can have arguments just like aliases can, and they're accessed in exactly the same way:
Events can also have named arguments:
%params and %-1-%-99 can also be used just like they can be in aliases.
You can use custom events to improve the working of your scripts. Events raised with the #RAISE command can be given parameters:
raises the event defined above and sets $code to the value of 401. You can also use the #RAISE command to raise any of the predefined events in TeSSH, though you should obviously be careful when doing so.
Events are useful in a number of situations.
Add comment