Solaris Common Desktop Environment: Advanced User's and System Administrator's Guide

How Actions Use Data Files as Arguments

An argument of a command is the thing, usually a file, that the command acts upon. Actions can be written to accept file arguments.

For example, the EXEC_STRING of the Xwud action specifies that a file argument is required:

EXEC_STRING				/usr/bin/X11/xwud -noclick -in \
 							%(File)Arg_1"Xwd File To Display:"%

The term Arg stands for the word argument. The syntax Arg_1 means the first argument, and (File) means that the action treats that argument as a file.

The easiest way for the user to provide a file argument is to drop a data file on the application icon. The desktop determines the path of the dropped file and substitutes it into the command line in place of the text between the % symbols (%(File)Arg_1"Xwd File To Display:"%). Thus, the command that gets executed is:

/usr/bin/X11/xwud -noclick -in file_path

When the user double-clicks the application icon, the desktop determines from the EXEC_STRING that a file argument is required, and displays a dialog box prompting the user to enter a file name or path. In the case of the Xwud action, the prompt is:

Xwd File To Display:

The file name or path supplied by the user is used as the file argument.