-
-
Notifications
You must be signed in to change notification settings - Fork 18
Documentation ARexxAPI
With the help of ARexx scripts, you can add new functions to YAM or let it do things automatically.\ YAM offers a set of commands (listed in this documentation both #FixListByName and #FixListByFunction) which can be called through the YAM ARexx port. They are explained along the following subchapters using the following format:
NAME:: The name of the command, a short description of what it does and the YAM version where the command was implemented.
TEMPLATE:: Arguments and options accepted by the command. The template uses special characters that indicate the particular type of argument expected, following the AmigaDOS template style:
/A
The parameter is compulsory\
/K
The parameter must be preceeded by the keyword\
/N
Numerical argument or result\
/M
Argument or result is a list of zero or more elements\
/S
The parameter works as a switch; the switch is in use when the parameter is given\
FUNCTION:: Describes what the command will do.
INPUTS:: Describes in detail the parameters accepted by the command. Be careful when passing arguments containing spaces; for instance,
{{{#!arexx sub = 'Hello World' 'WRITESUBJECT' sub }}}
won't work. It must be written as
{{{#!arexx 'WRITESUBJECT "'sub'"' }}}
or
{{{#!arexx 'WRITESUBJECT "Hello World"' }}}
Please note that because of the internal use of the ReadArgs() function, the ARexx Host requires to escape certain special characters like a newline (0x0a) or escape character (0x1b) if you want to have it included in your final string or otherwise it is stripped by the ReadArgs() function.
This means that you have to use the following escape sequences in your provided strings:
*N
substitutes to 0x0a (newline \n) \
*E
substitutes to 0x1b (escape)\
**
substitutes to *\
*"
substitutes to "\
For example the following command would write a string to a texteditor containing a newline:
{{{#!arexx 'WRITEEDITOR "TEXT Hello Joe,*N I would like to meet you."' }}}
If a parameter represents a file name you should keep in mind that file names on AmigaOS might contain spaces or other special characters which will cause ARexx to treat the name as multiple words instead of a single word. Hence a file name should always be surrounded by quotes, no matter if it contains spaces or not. Scripts can very easily be tested for this case by letting them handle a file in the Amiga RAM disk, i.e. "RAM Disk:/foo/bar".
RETURNS:: Returned info to be expected from the command. Commands may return results in three different kinds; let's look at these examples which use the FOLDERINFO command:
{{{#!arexx FOLDERINFO -> RESULT = "0 Incoming incoming 10 2 4 23030 1" }}}
{{{#!arexx FOLDERINFO VAR fi -> fi = "0 Incoming incoming 10 2 4 23030 1" }}}
{{{#!arexx FOLDERINFO STEM fi. -> fi.number = 0 fi.name = "Incoming" fi.path = "incoming" fi.total = 10 fi.new = 2 fi.unread = 4 fi.size = 23030 fi.type = 1 }}}
Another example which returns a result of type /M
:
{{{#!arexx ADDRFIND STEM found. "Marcel Beck" NAMEONLY -> found.alias.count = 2 found.alias.0 = "Mars" found.alias.1 = "mbe" }}}
IMPORTANT NOTE: Always check the RC return code after the command execution before examining any further returned variables (e.g. as part of a STEM variable). Additional variables will only be set for successfully executed commands which return zero (0) in RC. A failed command execution (RC != 0
) will leave these variables in an uninitialized state which could potentially lead to undesired results.
WARNING:: Any sort of vital information you should be aware of when using this command.
NOTES:: Various notes about the command.
EXAMPLE:: A fragment of ARexx code to illustrate the usage of the command.
BUGS:: Problems that are known or have already been fixed with this command.
SEE ALSO:: Links to other related commands.
ARexxAPI/HELP - Return a list of all the supported ARexx commands\ ARexxAPI/HIDE - Iconify YAM\ ARexxAPI/INFO - Return information about the program\ ARexxAPI/QUIT - Terminate YAM\ ARexxAPI/SCREENTOBACK - Bring the YAM screen to the background\ ARexxAPI/SCREENTOFRONT - Bring the YAM screen to the foreground\ ARexxAPI/SHOW - Uniconify YAM\
ARexxAPI/ADDRDELETE - Remove an entry from the address book\ ARexxAPI/ADDREDIT - Fill the fields of the current address book entry\ ARexxAPI/ADDRFIND - Search the address book for one or more entries\ ARexxAPI/ADDRGOTO - Select an address book entry by alias\ ARexxAPI/ADDRINFO - Return information about an entry referred by alias\ ARexxAPI/ADDRLOAD - Load an address book by filename\ ARexxAPI/ADDRNEW - Create a new entry in the address book\ ARexxAPI/ADDRRESOLVE - Resolve an alias or name\ ARexxAPI/ADDRSAVE - Save the address book under a given filename\
ARexxAPI/FLUSHINDEXES - Flush the index of all folders\ ARexxAPI/FOLDERINFO - Return information about a given folder\ ARexxAPI/GETFOLDERINFO - Return information about the current folder\ ARexxAPI/MAILFILTER - Filter messages in the current folder\ ARexxAPI/MAILUPDATE - Update the index of the current folder\ ARexxAPI/NEWMAILFILE - Return a free message slot for a given folder\
ARexxAPI/APPBUSY - Switch YAM to busy mode\ ARexxAPI/APPNOBUSY - Bring YAM out of busy mode\ ARexxAPI/LISTFREEZE - Forbid graphical updates to a list\ ARexxAPI/LISTUNFREEZE - Permit graphical updates to a list\ ARexxAPI/READCLOSE - Close the active Read window\ ARexxAPI/RESTART - Restart YAM\
ARexxAPI/FINDMAIL - Find a mail in all folders given a MessageID\ ARexxAPI/GETSELECTED - Get the position of the messages selected in the current folder\ ARexxAPI/LISTSELECT - Select messages in the current folder\ ARexxAPI/SETFOLDER - Select the current folder\ ARexxAPI/SETMAIL - Select the current message in the current folder by number\ ARexxAPI/SETMAILFILE - Select the current message in the current folder by filename\
ARexxAPI/GETMAILINFO - Return information about the active message\ ARexxAPI/MAILARCHIVE - Move the selected messages to another folder\ ARexxAPI/MAILBOUNCE - Bounce the current message\ ARexxAPI/MAILCHANGESUBJECT - Change the subject of the selected message(s)\ ARexxAPI/MAILCOPY - Duplicate the selected message(s)\ ARexxAPI/MAILDELETE - Delete the selected message(s)\ ARexxAPI/MAILEDIT - Edit the current message\ ARexxAPI/MAILEXPORT - Export the selected message(s) into a file\ ARexxAPI/MAILIMPORT - Import messages from a file into the current folder\ ARexxAPI/MAILINFO - Return information about a given message\ ARexxAPI/MAILMOVE - Move the selected messages to another folder\ ARexxAPI/MAILREAD - Read the current message\ ARexxAPI/MAILREPLY - Reply the currently selected messages\ ARexxAPI/MAILSTATUS - Change the status of the selected message(s)\ ARexxAPI/READINFO - Get info about the attachments in the message being read\ ARexxAPI/READPRINT - Print an attachment\ ARexxAPI/READSAVE - Save an attachment\ ARexxAPI/SETFLAG - Set the PERmanent or VOLatile flag of a message\
ARexxAPI/GETURL - Download a file from the WWW based on a given URL\ ARexxAPI/ISONLINE - Detect whether YAM is currently transfering email\ ARexxAPI/MAILCHECK - Download new email\ ARexxAPI/MAILSEND - Send the messages in the Outgoing folder\ ARexxAPI/MAILSENDALL - Send all the messages in the Outgoing folder\
ARexxAPI/GETCONFIGINFO - Return information about the current user\ ARexxAPI/REQUEST - Request a choice from the user\ ARexxAPI/REQUESTFILE - Request the user to select a file\ ARexxAPI/REQUESTFOLDER - Request the user to select a folder\ ARexxAPI/REQUESTSTRING - Request the user for a string\ ARexxAPI/USERINFO - Return information about the current user\
ARexxAPI/MAILFORWARD - Forward the selected messages\ ARexxAPI/MAILWRITE - Open a new Write window to compose a new mail\ ARexxAPI/WRITEATTACH - Attach a file to a new message\ ARexxAPI/WRITEBCC - Fill the BCC: header of a new message\ ARexxAPI/WRITECC - Fill the CC: header of a new message\ ARexxAPI/WRITEEDITOR - Pass an ARexx command to the internal editor\ ARexxAPI/WRITEFROM - Fill the FROM: header of a new message\ ARexxAPI/WRITEIDENTITY - Choose the user identity to be used when composing a new mail\ ARexxAPI/WRITELETTER - Load a file into the internal text editor\ ARexxAPI/WRITEMAILTO - Fill the TO: header of a new message\ ARexxAPI/WRITEOPTIONS - Set the options of a new message\ ARexxAPI/WRITEQUEUE - Move a new message to the Outgoing queue\ ARexxAPI/WRITEREPLYTO - Fill the REPLY-TO: header of a new message\ ARexxAPI/WRITESEND - Send a new message\ ARexxAPI/WRITESUBJECT - Fill the SUBJECT: header of a new message\ ARexxAPI/WRITETO - Fill the TO: header of a new message\
ARexxAPI/ADDRDELETE - Remove an entry from the address book\ ARexxAPI/ADDREDIT - Fill the fields of the current address book entry\ ARexxAPI/ADDRFIND - Search the address book for one or more entries\ ARexxAPI/ADDRGOTO - Select an address book entry by alias\ ARexxAPI/ADDRINFO - Return information about an entry referred by alias\ ARexxAPI/ADDRLOAD - Load an address book by filename\ ARexxAPI/ADDRNEW - Create a new entry in the address book\ ARexxAPI/ADDRRESOLVE - Resolve an alias or name\ ARexxAPI/ADDRSAVE - Save the address book under a given filename\ ARexxAPI/APPBUSY - Switch YAM to busy mode\ ARexxAPI/APPNOBUSY - Bring YAM out of busy mode\ ARexxAPI/FINDMAIL - Find a mail in all folders given a MessageID\ ARexxAPI/FLUSHINDEXES - Flush the index of all folders\ ARexxAPI/FOLDERINFO - Return information about a given folder\ ARexxAPI/GETCONFIGINFO - Return information about the current user\ ARexxAPI/GETFOLDERINFO - Return information about the current folder\ ARexxAPI/GETMAILINFO - Return information about the active message\ ARexxAPI/GETSELECTED - Get the position of the messages selected in the current folder\ ARexxAPI/GETURL - Download a file from the WWW based on a given URL\ ARexxAPI/HELP - Return a list of all the supported ARexx commands\ ARexxAPI/HIDE - Iconify YAM\ ARexxAPI/INFO - Return information about the program\ ARexxAPI/ISONLINE - Detect whether YAM is currently transfering email\ ARexxAPI/LISTFREEZE - Forbid graphical updates to a list\ ARexxAPI/LISTSELECT - Select messages in the current folder\ ARexxAPI/LISTUNFREEZE - Permit graphical updates to a list\ ARexxAPI/MAILARCHIVE - Move the selected messages to another folder\ ARexxAPI/MAILBOUNCE - Bounce the current message\ ARexxAPI/MAILCHANGESUBJECT - Change the subject of the selected message(s)\ ARexxAPI/MAILCHECK - Download new email\ ARexxAPI/MAILCOPY - Duplicate the selected message(s)\ ARexxAPI/MAILDELETE - Delete the selected message(s)\ ARexxAPI/MAILEDIT - Edit the current message\ ARexxAPI/MAILEXPORT - Export the selected message(s) into a file\ ARexxAPI/MAILFILTER - Filter messages in the current folder\ ARexxAPI/MAILFORWARD - Forward the selected messages\ ARexxAPI/MAILIMPORT - Import messages from a file into the current folder\ ARexxAPI/MAILINFO - Return information about a given message\ ARexxAPI/MAILMOVE - Move the selected messages to another folder\ ARexxAPI/MAILREAD - Read the current message\ ARexxAPI/MAILREPLY - Reply the currently selected messages\ ARexxAPI/MAILSEND - Send the messages in the Outgoing folder\ ARexxAPI/MAILSENDALL - Send all the messages in the Outgoing folder\ ARexxAPI/MAILSTATUS - Change the status of the selected message(s)\ ARexxAPI/MAILUPDATE - Update the index of the current folder\ ARexxAPI/MAILWRITE - Open a new Write window to compose a new mail\ ARexxAPI/NEWMAILFILE - Return a free message slot for a given folder\ ARexxAPI/QUIT - Terminate YAM\ ARexxAPI/READCLOSE - Close the active Read window\ ARexxAPI/READINFO - Get info about the attachments in the message being read\ ARexxAPI/READPRINT - Print an attachment\ ARexxAPI/READSAVE - Save an attachment\ ARexxAPI/REQUEST - Request a choice from the user\ ARexxAPI/REQUESTFILE - Request the user to select a file\ ARexxAPI/REQUESTFOLDER - Request the user to select a folder\ ARexxAPI/REQUESTSTRING - Request the user for a string\ ARexxAPI/RESTART - Restart YAM\ ARexxAPI/SCREENTOBACK - Bring the YAM screen to the background\ ARexxAPI/SCREENTOFRONT - Bring the YAM screen to the foreground\ ARexxAPI/SETFLAG - Set the PERmanent or VOLatile flag of a message\ ARexxAPI/SETFOLDER - Select the current folder\ ARexxAPI/SETMAIL - Select the current message in the current folder by number\ ARexxAPI/SETMAILFILE - Select the current message in the current folder by filename\ ARexxAPI/SHOW - Uniconify YAM\ ARexxAPI/USERINFO - Return information about the current user\ ARexxAPI/WRITEATTACH - Attach a file to a new message\ ARexxAPI/WRITEBCC - Fill the BCC: header of a new message\ ARexxAPI/WRITECC - Fill the CC: header of a new message\ ARexxAPI/WRITEEDITOR - Pass an ARexx command to the internal editor\ ARexxAPI/WRITEFROM - Fill the FROM: header of a new message\ ARexxAPI/WRITEIDENTITY - Choose the user identity to be used when composing a new mail \ ARexxAPI/WRITELETTER - Load a file into the internal text editor\ ARexxAPI/WRITEMAILTO - Fill the TO: header of a new message\ ARexxAPI/WRITEOPTIONS - Set the options of a new message\ ARexxAPI/WRITEQUEUE - Move a new message to the Outgoing queue\ ARexxAPI/WRITEREPLYTO - Fill the REPLY-TO: header of a new message\ ARexxAPI/WRITESEND - Send a new message\ ARexxAPI/WRITESUBJECT - Fill the SUBJECT: header of a new message\ ARexxAPI/WRITETO - Fill the TO: header of a new message\