There are three ways for actions to handle multiple file arguments:
The action can be run repreatedly, once for each argument. When an EXEC_STRING contains a single file argument and multiple file arguments are provided by dropping multiple files on the action icon, the action is run separately for each file argument.
For example if multiple file arguments are supplied to the following action definition:
ACTION DisplayScreenImage { EXEC_STRING xwud -in %Arg_1% ... }
the DisplayScreenImage action is run repeatedly.
The action can use two or more non-interchangeable file arguments. For example:
xsetroot -cursor cursorfile maskfile
requires two unique files in a particular order.
The action can perform the same command sequentially on each file argument. For example:
pr file [file ...]
will print one or many files in one print job.
Use one of the following syntax conventions:
If you want the action to prompt for the file names, use this syntax for each file argument:
%(File)"prompt"%
Use a different prompt string for each argument.
For example, this execution string prompts for two files.
EXEC_STRING xsetroot -cursor %(File)"Cursor bitmap:"% \ %(File)"Mask bitmap:"%
To accept dropped files, use this syntax for each file argument:
%Arg_n%
using different values of n for each argument. For example:
EXEC_STRING diff %Arg_1% %Arg_2%
Use one of the following syntax conventions:
To create an action that accepts dropped files and issues a command in the form command file 1 file 2 ..., use this syntax for the file arguments:
%Args%
To create an action that accepts multiple dropped files, or displays a prompt for a single file when double-clicked, use this syntax for the file arguments:
%Arg_1"prompt"% %Args%
The action will issue the command in the form: command file 1 file 2 ....
This execution string creates an action that executes:
pr file 1 file 2
with multiple file arguments.
EXEC_STRING pr %Args%
This execution string creates an action similar to the previous example, except that the action displays a prompt when double-clicked (no file arguments).
EXEC_STRING pr %Arg_1"File(s) to print:"% %Args%
To accept multiple dropped file arguments and execute a command line in the form:
command file 1 file 2 ...
use the syntax:
%Args%
This execution string executes a script named Checkout for multiple files:
EXEC_STRING /usr/local/bin/Checkout \ %Arg_1"Check out what file?"% %Args%