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

Invoking Actions from a Command Line

The desktop provides the dtaction command for running actions from a command line. You can use dtaction to run actions from:

Syntax of dtaction

dtaction [-user user_name] [-execHost hostname] \
 action_name [argument [argument]…]

-user user_name—provides the ability to run the action as a different user. If dtaction is invoked by a user other than user_name, a prompt is displayed for the password.

-execHost hostname—for COMMAND actions only; specifies the host on which the command will be run.

argument—arguments to the action; usually file arguments.

The dtaction client has additional command-line options. For more information, see the dtaction(1) man page.

Creating an Action that Runs Another Action

Use dtaction in the EXEC_STRING of the action.

For example, the following action uses a built-in action named Spell (the action is labeled ``Check Spelling'' in Application Manager). The new action runs Text Editor and the Spell action, displaying the spelling errors in a separate terminal emulator window.

ACTION EditAndSpell
 {
 	WINDOW_TYPE				NO_STDIO
 	EXEC_STRING				/bin/sh -c 'dtaction Spell \
 								%Arg_1"File:"%; dtpad %Arg_1%'
 }

Creating an Action that Runs as a Different User

Use the following syntax in the EXEC_STRING:

EXEC_STRING   dtaction -user user_name action_name [file_argument]

The new user (user_name) must have display access to the system through one of the following mechanisms: