Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP Visual User Environment 3.0 User's Guide > Chapter 21 More About Actions

Creating Actions With Multiple File Arguments

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

There are two ways to implement an action that accepts multiple file arguments:

  • The action can use two or more non-interchangeable file-arguments. For example, the command:

       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, the command:

       pr file [file  ...]
    
    will print one or many files in one print job.

To write an action for non-interchangeable arguments

  • If you want the action to prompt for the file names, use this syntax for each file argument:

       %(File)"prompt"%
    
    using different prompts for each argument.

  • To accept dropped files, use this syntax for each file argument:

       %(File)Arg_n%
    
    using different values of n for each argument.

Example.  This execution string prompts for two files.

   EXEC-STRING xsetroot -cursor %(File)"Cursor bitmap:"% \

                                %(File)"Mask bitmap:"%  

Example.  This execution string accepts two dropped files. Since order is essential, it may be necessary to reorder the files in the file manager before dragging them to the action icon.

   EXEC-STRING xsetroot -cursor %(File)Arg_1% \

                                %(File)Arg_2% 


To write actions with multiple, interchangeable file arguments

  • To create an action that accepts dropped files and issues a command in the form: command file1 file2 ..., use this syntax for the file arguments:

       %(File)Args%
    

  • To create an action that accepts dropped files or displays a prompt when double-clicked, use this syntax for the file arguments.

       %(File)Arg_n"prompt"% %(File)Args%
    

    The action will issue the command in the form: command file1 file2 ....

  • To create an action that accepts multiple dropped files and issues a series of commands in the form:

       command file
    
       command file
    
         ...
    

    use this syntax for the file arguments:

       %(File)Arg_1
    

    Use this syntax when the command must be issued separately for each file argument.

Example.  This execution string creates an action that executes:

   pr file⊂1  file⊂2

with multiple file arguments. The action has no double-click functionality

   EXEC-STRING  pr %(File)Args%

Example.  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 %(File)Arg_1"File(s) to print:"% %(File)Args%

Example.  This execution string creates an action that executes:

   xwud -in file

repeatedly if you supply multiple file arguments.

   EXEC-STRING  xwud -in %(File)Arg_1%

To write an action for multiple dropped files

  • To accept multiple file arguments that are dropped on the action,execute a command in the form:

       command file__1__ file__2__  ...
    

    use the syntax:

       %(File)Args%
    

Example.  This execution string executes a script named Checkout for multiple files.

   EXEC-STRING /usr/local/bin/Checkout \

               %(File)Arg_1"Check out what file?"% %(File)Args%

Example.  This execution string performs the diff command on two files. None, one, or both files can be supplied by dropping the file(s) on the action icon. A dialog box with prompt(s) appears if no file or one file is dropped.

   EXEC-STRING diff %(File)Arg_1"Original File:"% %(File)Arg_2"Altered File:"%

Example.  This execution string executes lp -oraw with multiple files:

   EXEC-STRING /usr/bin/lp -oraw %(File)Arg_1"File to print:"% %(File)Args%

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© © 1989, 1990, 1991, 1992, 1995 Hewlett-Packard Development Company, L.P.