There are two ways that data types are associated with actions:
The ACTIONS field in the DATA_ATTRIBUTES definition lists the actions
that will appear in File Manager's Selected menu. The first action in the
list is the default (double-click) action.
Actions can be restricted to specified data types using the action definition's ARG_TYPE field.
For example, the following data type definition creates a data type for special “readme” files created by your system administrator that use the naming convention *.rm.
DATA_ATTRIBUTES SysReadmeFile
{
ICON SysReadMe
ACTIONS Open,Respond
}
DATA_CRITERIA SysReadmeFileCriteria
{
NAME_PATTERN *.rm
DATA_ATTRIBUTES_NAME SysReadmeFile
}
A special Respond action is defined below for the file. It opens a writable copy of the file in Text Editor. When the file is saved and Text Editor is exited, the file is mailed to the system administrator (mail address sysadmin@utd).
ACTION Respond
{
ARG_TYPE SysReadmeFile
EXEC_STRING /bin/sh -c 'cp %Arg_1% $HOME/readme.temp;\
chmod +w $HOME/readme.temp; \
dtpad $HOME/readme.temp; \
cat $HOME/readme.temp | \
/usr/bin/mailx sysadmin@utd; \
rm $HOME/readme.temp'
WINDOW_TYPE NO_STDIO
}