FileType

The FileType internal command can be used to:

 

Command Arguments:

Argument

Type

Possible values

Description

ACTION

 

<event>

Trigger a file-type-defined event for the selected files. For example, you could use this to trigger the drag-and-drop event for a file from a button or hotkey. This is the default argument for the FileType command - you do not need to specify the ACTION keyword.

The value must be one of the following event keywords: open, explorer, find, print, drop, dropshift, dropctrl, dropalt, dblclk, dblclkshift, dblclkctrl, dblclkalt, mdblclk, mdblclkalt, mdblclkshift and mdblclkctrl.

Example: FileType drop

CONTEXTFORCE

/S

(no value)

When used with the CONTEXTMENU argument, this overrides the Hide Windows items on file context menus option on the Miscellaneous / Windows Integration page in Preferences.

Example: FileType CONTEXTMENU CONTEXTFORCE

CONTEXTMENU

/O

(no value)

Displays the standard system context menu for the selected files and folders (acts as a dynamic button). This lets you embed the context menu in a drop-down menu (used in the default File menu, for example). You could also use this in conjunction with the CONTEXTFORCE option to shunt the full Windows context menu into a sub-menu of the normal context menu.

Example: FileType CONTEXTMENU

 

 

<GUID>

Displays any context menu items added by the specified context menu extension. This gives you the ability (in conjunction with the Hide Windows items on file context menus option) to control exactly which context menu items are shown on your context menu. You need to know the GUID for the context menu extension in question, and finding that out is beyond the scope of this help file - instead, see this article on the Opus Resource Centre for an example of how this might be used.

Example: FileType CONTEXTMENU {FB314ED9-A251-47B7-93E1-CDD82E34AF8B} CONTEXTFORCE

 

 

<file class>

Displays any context menus for the specified file class. This gives you the ability (in conjunction with the Hide Windows items on file context menus option) to control exactly which context menu items are shown on your context menu.

Example: FileType CONTEXTMENU jpegfile

CONTEXTOPTIONS

/K

INCLUDE=<type>

When used in conjunction with CONTEXTMENU Directory\Background, this lets you include specific file types (and exclude all others) from the generated shell New menu that is added. Note that you must enclose the value in quotes, as it contains an equals sign that would otherwise confuse the command parser.

Example: FileType CONTEXTMENU Directory\Background CONTEXTOPTIONS "INCLUDE=.bmp,.jpg,.gif"

 

 

EXCLUDE=<type>

Exclude the specified file types from the generated shell New menu when used with CONTEXTMENU Directory\Background. You can also use * to totally disable the New menu in this context.

Example: FileType CONTEXTMENU Directory\Background CONTEXTOPTIONS "EXCLUDE=*"

EDIT

/S

(no value)

Displays the File Type editor for the file type corresponding to the selected file. You could add this command to the context menu for All Files and Folders to enable you to quickly edit the file type definition for any file.

Example: FileType EDIT

FILE

/K/M

<filename> ...

Specify the filename or names to perform the file type action on. If not specified, all selected files in the current source folder will be used.

Example: FileType open FILE C:\Data\sales.xls

FROMCLIPBOARD

/O

(no value)

Use in conjunction with the NEW argument to create one or more new files with names drawn from the clipboard contents. This is designed to be step two of a two-part operation; the first part being copying the names of one or more files to the clipboard with the Clipboard COPYNAMES command.

Opus will make a new file of the specified type for each filename on the clipboard. If the clipboard contains fully qualified pathnames the new files will be created in the same location as the source files (unless overridden by the PATH argument). If the clipboard contains only filenames without paths, the new files will be created in the current source file display.

Example: FileType NEW=.txt FROMCLIPBOARD

 

 

keepext

Specify this argument to preserve the file extensions of the files on the clipboard.

Example: FileType NEW=.txt FROMCLIPBOARD=keepext

NEW

/K

<file type>

Create a new file of the specified type. This is equivalent to selecting the appropriate item from the New context menu. Only files that have a registered "new" handler can be created in this manner - so if a file type doesn't appear in the New context menu you won't be able to create one with this command. Use the NEWNAME argument to modify the default name of the new file.

Example: FileType NEW .txt

The FileType NEW command automatically sets a variable called newfile to the name of the newly created file. To insert the variable, use {$newfile}.

NEWMENU

/S

(no value)

Displays the shell New menu, that lets you create new files of various types by selecting the appropriate item from the menu (acts as a dynamic button). This lets you embed the New menu in a drop-down menu.

Example: FileType NEWMENU

NEWNAME

/K

<new filename>

Specifies the filename when creating a new file via the NEW argument. If you don't specify the name, a default filename is used. By default, when a new file is created Opus will initiate inline rename on the new item allowing you to rename it. If you want to specify your own filename and prevent the inline rename behaviour, prefix your filename with the norename: string.

Example: FileType NEW .txt NEWNAME "norename:Text File.txt"

OPENWITHMENU

/S

(no value)

Displays the shell Open With menu, that lets you choose the program to open selected files with (acts as a dynamic button). This lets you embed the Open With menu in a drop-down menu.

Example: FileType OPENWITHMENU

PATH

/K

<path>

Use this in conjunction with the NEW argument to create a new file in a location other than the current source file display. Note that when you use this argument the newly created file will not be put into inline rename mode automatically.

Example: FileType NEW .txt PATH "{destpath}"

SENDTOMENU

/S

(no value)

Displays the shell Send To menu, that lets you send selected files and folders to various programs and destinations (acts as a dynamic button).

Example: FileType SENDTOMENU

 

 

nosub

By default the Send To menu is displayed as a sub-menu; by adding the nosub value the items within the Send To list will be added directly to the toolbar or drop-down menu containing the FileType SENDTOMENU command.

Example: FileType SENDTOMENU=nosub

 

 

shift

Forces the Send To menu to be built as if the Shift key were held down. On some versions of Windows an extended menu is shown when Shift is held.

Example: FileType SENDTOMENU=nosub,shift