Creating Actions and Data Types Using Create ActionCreate ActionCreate Action is a tool for creating:Create ActionintroductiondtCreate, See Create ActionAn action to start an applicationOne or more data types for an application's data filesActions for opening and printing the application's data filesCreate Action is also useful for creating simple actions for running operating
system commands and shell scripts.For reference information, see the dtcreate(1) man page.What Create Action DoesCreate ActionfunctionalityCreate Action includes a main window and a set of dialog boxes for creating
an action and its associated data types.Create Action does the following:Creates an action definition that runs a command.Create Actionconfiguration file createdaction definition file, created by Create ActionCreates a file HomeDirectory/.dt/types/action_name.dt. This file stores
the action and data type definitions created for the application.Creates anaction fileaction file in the user's home directory. The action file is an
executable file with the sameactionsname
name as the action.The action file's representation in File Manager is called anapplication iconusing Create Actionapplication icon
because double-clicking it starts the application.Optionally, you can make the action icon a drop zone by specifying
dropable data types when you create the action.Creates one or more data types for the application's data files (optional).Creates an Open action for each data type.Creates a Print action for each data type (optional).Reloads the database of actions and data types. This makes the actions and
data types take effect immediately.Limitations of Create ActionCreate ActionlimitationsCreate Action is designed to create actions and data types for running
applications. However, actions and data types are very flexible, and include
additional functionality that can only be accessed if you create the definitions
manually.For more information, see:Action Limitationsactionslimitations of Create ActionYou cannot use Create Action to create the action for an application if any of
the following conditions are true:The command line requires aactionsnon-file arguments<$nopage>actionsparameters, See arguments
non-file argument (parameter).For example, you cannot use Create Action to write an action for the
command:lp -ddevice filenamewhere the user has to supply device each time the command is executed.The application icon must have a different label than the action name.For example, you cannot use Create Action to provide a local-language
version of an existing action.The action requires any of the advanced features of the action database.Examples of these advanced features are actions that:Launch commands on systems remote from the action definitionInvoke other actionsMust be run as a different user (for example, as superuser)Make extensive use of the ``map'' featureHave very different behaviors, depending on the number of file
arguments supplied to the actionData Type Limitationsdata typesrequirements for manual creationdata typeslimitation of Create ActionYou cannot use Create Action to create the data type for an application if any
of the following conditions are true:The data type must have additional actions associated with it other than
Open and Print.The Open action for the data type is not the action's command.For example, you cannot use Create Action to create the data type that
provides a unique icon for the directory representing the application's
application group.Creating an Action and Data Type for an Application with Create ActionCreate ActionusingThere are some things you'll need to know about the application before you
run Create Action.The command line for starting the application.You'll need to know whether the command line includes a required file
argument, an optional file argument, or no file argument.If the application requires a non-file argument, you cannot use Create
Action to create the action.The types of data files an application can accept.Some applications can accept only one type of data. Others (for example, an
ASCII editor or graphics editor) can accept multiple data types.The way the application identifies its data files.This may be a naming convention (for example, file names ending
with.doc), and/or may depend on the content of the file. If the application
does not use a file-name convention, you can still set one up for the action
icon.Optional: The command line to print the filesTo Create an Action for an ApplicationDouble-click Create Action in the Desktop_Apps application group.Create ActionstartingCreate Action icon in Application ManagerCreate Actionmain windowThis displays the main Create Action window.Create Action main windowType the name that will label the action icon into theAction Name field in Create ActionCreate Actionaction name
Action Name text field.Use theAction Icons controls, in Create Action
Action Icons controls to specify the icon for the application. Initially,
the default icon is shown.To choose a different, existing icon, click Find Set to display the Find Set
dialog box. See
.To create new icons, choose Edit Icon to run the Icon Editor.In the Command When Action Icon Is Opened text field, type the command
to start the application.Create Actionaction command syntaxUse the syntax $n for a file argument; for example:emacs
bitmap $1
diff $1 $2
lp -oraw $1
If the command line includes a file argument
($n), then the
action icon will be a drop zone for files.Create Actionspecifying file argumentfile argumentspecified with Create ActionThe command lines are not passed to a shell unless you explicitly specify
the use of a shell. For example, these lines use shell processing:/bin/sh -c 'ps | lp'
/bin/sh -c 'spell $1 | more'
Type the On Item help text for the action icon into the Help Text For Action
Icon text field.helpspecified using Create ActionThe text will automatically wrap in the text field. However, these line breaks
are not preserved online. If you want to specify a hard line break, use .actionswindow supportwindow support for actionsChoose the windowing support required by the action from the Window
Type option menu.Graphical (X-Window)The application creates its own windowTerminal (Auto-Close)terminal emulatoraction auto-close optionThe application will run in a terminal emulator
window that closes automatically when the
user exits the applicationTerminal (Manual Close)terminal emulatoraction manual-close optionThe application will run in a terminal emulator
window that remains open until the user
explicitly closes itNo Outputactionsno display outputThe application does not produce output to the
displayProceed as follows:If your application has data files, and you want to create one or more data
types for them, see the next section,
.''If you do not need to create a data type, save the action by choosing Save
from the File menu. Then, test the new action by double-clicking its icon
in your home directory.To Create One or More Data Types for an ApplicationCreate Actiondata type creationdata typescreated with Create ActionDefine the action for the application using the procedure in the previous
section,
.Click the Advanced button in the Create Action window to expand the
window.Advanced features in the main Create Action windowfile prompt, specified with Create ActionCreate Actionfile promptIf you want the application icon to prompt for a file argument when the icon
is double-clicked, type the text of the prompt into the ``When Action Opens,
Ask Users for'' text field.Use these guidelines for this text field:You must use this field if the application's command line has a required file
argument.You must leave this field blank if the command line does not include a file
argument.If the file argument in the application's command line is optional, you
have a choice. If you supply the prompt text, the action icon will prompt
for the file when double-clicked. If you do not supply the prompt text, the
action will be executed with a null string as the file argument.Specify the types of files that the action will accept as arguments:If the action can accept any data type, select All Data Types.If the action can accept only the data type(s) you create for the application,
select Only Above List.Initially, theData Types list in Create Action
Datatypes That Use This Action list is empty. As you create
data types for the application, they are added to the list.Click Add beside the Datatypes That Use This Action list box to display the
Add Data Type dialog box.Create Action's Add Datatype dialog boxOptional: If you don't want to use the default data type name, type a new
name for the data type into theName of Data Type text fieldCreate Actiondata type name
Name of Datatype Family text field.The name cannot include spaces. The data type name is not visible to
application users; it is used in the actions/data types database to identify
the data type definition.Click the Edit button beside theIdentifying Characteristicsdialog box
Identifying Characteristics box to display
the Identifying Characteristics dialog box.Create Action's Identifying Characteristics dialog boxCharacteristics of a data type are the criteria used to differentiate the data
type from others. You can choose one or more of the following criteria:Files or FolderThe data type applies only to files or only to foldersName Patterndata typesname-basedname-based data typesData typing based on the file namePermission Patternpermission pattern, specified with Create Actiondata typespermission patternRead, write, execute permissionsContentsdata typescontent-basedcontent-based data typeContents of a specified portion of the fileSelect whether the data type represents a file or folder.
Specifying a file or directory characteristic for a data type.If the data typing depends on the name, select the Name Pattern check box
and fill in the text field.Specifying the file name characteristic for a data typeYou can use * and ? as wildcards:*Matches any sequence of characters?Matches any single characterIf the data typing depends on the permissions, select the
Permission Pattern check box and select the permissions for the data type.
Specifying the permission characteristics for a data typeOnThe file must have the specified permissionOffThe file must lack the specified permissionEitherThe specified permission does not matterIf the data typing depends on the contents, select the Contents
check box and supply the requested information—Pattern to search for and
Type of contents. Optionally, you can supply the byte location where the
search should start.
Specifying the contents characteristics for a data typeUse of content-based data typing may affect the performance of the
system.Click OK to close the Identifying Characteristics dialog box.The characteristics will be displayed in the Identifying Characteristics field
using this coding:Identifying CharacteristicsfielddA directoryrThe file has read permissionwThe file has write permissionxThe file has execute permission!Logical operator NOT&Logical operator ANDType the help text for the data files into the Help Text text field.Use the Datatype Icons controls to specify the icon for the application.
Initially, the default icon is shown.To choose a different, existing icon, click Find Set to display the Find Set
dialog box. See
.To create new icons, click Edit Icon to run the Icon Editor.Verify the command in the Command to Open this Datatype text field. This
is the command that will be executed when the user double-clicks a data
file.Optional: If the application supplies a print command for printing data files
from the command line, type the command into the Command to Print this
Datatype text field, using the syntax $n for a file argument.Do one of the following to save the data type definition:Click OK to save the data type and close the Add Datatype dialog box.Click Apply to save the data type without closing the Add Datatype dialog
box. This let you immediately proceed to define another data type for the
action.Using the Find Set Dialog Box To Specify an IconCreate Actionspecifying iconsiconsFind Set dialog boxFind Set dialog boxThe Find Set dialog box is displayed when you click Find Set in the Create
Action main window or in the Add Datatype window. Use the dialog box to
specify the icon that will be used for the action or data type.Find Set dialog boxdata typesicons foriconsdata typesiconsactionsactionsicons forThe Find Set dialog box lets you specify a set of icon image files located:In a directory on the icon search path. The Icon Folders list includes all the
directories on the icon search path.In a registration package that will be integrated with the desktop using
dtappintegrate. These icons are not yet located in a directory on the icon
search path, but will be placed there by dtappintegrate.The action and data type definitions created using Create Action write
out the base name for the icon files (the file name minus the file-name suffixes
for size and type). Icons for actions and data types created with Create Action
must eventually be placed in directories on the icon search path.To Specify a Set of Icons Located on the Icon Search PathIn the Find Set dialog box's Icon Folders list, double-click the folder path
containing the icon.The Icon Files list will show all the icon files in that folder.In the Icon Files list, click the icon you want to use.This places the base name of the icon file in the Enter Icon File name text
field.Click OK.To Specify an Icon in a Registration PackageIf you are a system administrator or programmer creating a registration
package, the icon image files are initially located in a directory in the
registration package:app_root/dt/appconfig/icons/languageAfter registration with dtappintegrate, the icon files will be copied to
/etc/dt/appconfig/icons/language, which is on the icon search path.Use this procedure to specify icons that are part of a registration package:In the Find Set dialog box's Enter Icon Filename text field, type the base
name of the icon file.Click OK.Create Action displays a dialog box to inform you that the icons were not
found in directories on the icon search path.In the information dialog box that appears, choose No Change.