Creating an Action Manually: General Steps
This section explains how to create a configuration file for an action definition.
Configuration Files for Actions
Configuration files containing action definitions must meet these requirements:
The files must use the naming convention name.dt
The files must be located on the database (actions and data types) search path. The default search path is:
Personal actions--HomeDirectory/.dt/types
System-wide actions--/etc/dt/appconfig/types/language
Built-in actions--/usr/dt/appconfig/types/language. You should not use this directory.
For information on modifying the actions/data types search path, see "Setting the Value of a Search Path".
To Create an Action Manually
Open an existing database file or create a new one.
See the previous section, "Configuration Files for Actions".
Create the action definition using the syntax:
ACTION action_name { TYPE action_type action_field ... }
where:
action_name--name used to run the action.
action_type--COMMAND (default), MAP, or TT_MSG.
action_field--one of the required or optional fields for this type of action. All fields consist of a keyword and a value.
Many of the action fields are covered in this chapter. For more information, see the dtactionfile(4) man page.
Save the file.
If you want the action icon to have a unique image, create the icons for the action. The default location for icons is:
Personal icons: HomeDirectory/.dt/icons
System-wide icons: /etc/dt/appconfig/icons/language. The default language is C.
For more information, see "Specifying the Icon Image Used by an Action".
Double-click Reload Actions in the Desktop_Tools application group.
Create an action file for the action. The action file creates an icon in File Manager or Application Manager that represents the action. (If the action is written to start an application, the icon is called an application icon.)
To create the action file, create an executable file with the same name as action_name. You can put the file in any directory to which you have write permission. You can create as many action files as you like.
Example of Creating a COMMAND Action
The following steps create a personal action that starts a fax application on remote system AppServerA. The command for starting the fax application is:
/usr/fax/bin/faxcompose [filename] |
Create the file HomeDirectory/.dt/types/Fax.dt.
Put the following action definition into the file:
ACTION FaxComposer { TYPE COMMAND ICON fax WINDOW_TYPE NO_STDIO EXEC_STRING /usr/fax/bin/faxcompose -c %Arg_1% EXEC_HOST AppServerA DESCRIPTION Runs the fax composer
}
The WINDOW_TYPE and EXEC_STRING fields describe the behavior of the action.
WINDOW_TYPE--the NO_STDIO keyword specifies that the action does not have to run in a terminal emulator window.
See "Specifying the Window Support for the Action".
EXEC_STRING--the syntax %Arg_1% accepts a dropped file. If the action icon is double-clicked, the action opens an empty fax composer window.
Save the file.
Use Icon Editor to create the following icon image files in the HomeDirectory/.dt/icons directory:
fax.m.pm, size 32 by 32 pixels
fax.t.pm, size 16 by 16 pixels
Double-click Reload Actions in the Desktop_Tools application group.
Create an executable file named FaxComposer in a directory to which you have write permission (for example, your home directory).