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 Manually

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

Creating an action manually (by editing a database file) gives you full access to all the functionality of actions.

Types of actions.  You can create two basic types of actions.

Action type

Description

COMMAND

An action that executes a command. A command action can start an application or utility, run a shell script, or execute an operating system command.

MAP

An action that is "mapped to" a command action. Mapping provides the ability to "enrich" an action name by giving it different functionality for different filetypes. You cannot use Create Action to create MAP actions.

See Also. 

To create an action manually

  1. Open an existing database file or create a new one. New database files must use the naming convention filename.vf and be located in directories on the database search path.

    • /etc/vue/config/types for system-wide actions (you must be superuser to create system-wide actions.

    • /HomeDirectory/.vue/types for personal actions.

    • /etc/vue/config/export for actions to be exported to other systems.

  2. Add the new action definition to the file. Store the file.

  3. If necessary, create the bitmaps for the action.

  4. Open the System_Admin subdirectory of the General Toolbox and double-click ReloadActions.

  5. Create an executable file with the same name as the action in the Personal Toolbox or General Toolbox. This file becomes the action icon. The file will use the icon and item help specified in the action definition.

See Also. 

Example: creating a COMMAND action

The following steps create an action that prints one or more PCL graphics file to a printer named lj3.

  1. Create the file /HomeDirectory/.vue/types/Print_actions.vf.

  2. Put the following action definition into the file:

       ACTION         Print_PCL_file
    
         TYPE         COMMAND
    
         DESCRIPTION  Prints a PCL file.
    
         WINDOW-TYPE  NO-STDIO
    
         EXEC-STRING  /usr/bin/sh -c 'lp -dlj3 -oraw \
    
                      %(File)Arg_1"File(s) to print:"% %(File)Args%'
    
       END
    
    The syntax %(File)Arg_1"File(s) to print:"% %(File)Args% accepts one or more dropped files, or prompts for the file argument if the action icon is double-clicked.

  3. Save the file.

  4. If necessary, create the PCL filetype. (You can use the same database file.)

       FILETYPE       PCL
    
         FILE-PATTERN *.pcl
    
         L-ICON       pcltype.l
    
         S-ICON       pcltype.s
    
         DESCRIPTION  Pcl-type file.  Double-click to print.
    
         ACTIONS      Print_PCL_file
    
       END
    

  5. Open the Utilities subdirectory of the General Toolbox and double-click ReloadActions.

  6. Open the Personal Toolbox and create an executable file named Print_PCL_file.

The Print_PCL_file action can be invoked two ways using its action icon:

  • Double-clicking the action icon displays a prompt for the file(s) to print.

  • Dropping one or more files on the icon prints the file.

See Also. 

Example: creating a MAP action

The following steps create an action that "enriches" the Print action for PCL-type files so that the drop zone in the Front Panel and the Print entry in the Actions menu prints a PCL file properly.

Example. 

  1. Create the file /HomeDirectory/.vue/types/Print_actions.vf.

  2. Define an action Print_Pcl_File that prints a PCL graphics file (such an action is defined in “Example: creating a COMMAND action”).

  3. Create an action that maps the Print action to the new Print_Pcl_File action. Use the ARG-TYPES field to specify that the mapping applies only to the PCL filetype.

       ACTION          Print
    
          ARG-TYPES    PCL 
    
          TYPE         MAP       Print_PCL_file
    
       END
    

  4. Create the PCL filetype.

       FILETYPE       PCL
    
         FILE-PATTERN *.pcl
    
         L-ICON       pcltype.l
    
         S-ICON       pcltype.s
    
         DESCRIPTION  Pcl-type file.  Double-click to print.
    
         ACTIONS      Print
    
       END
    

  5. Open the Utilities subdirectory of the General Toolbox and double-click ReloadActions.

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.