The ContextMenu command can be used to:
The first step in using the ContextMenu command is to select the file (or a file of the type) in question and use the SHOWCMDS argument to view the available context menu commands. The easiest way to do this (unless you want to set up a button dedicated to this) is to use the find-as-you-type field in Command mode.
Opus will display a dialog containing a list of the available context menu commands. Context menu commands have an ID number and some may also have a "verb" - a plain text string that you can use to invoke the command. If a command has a verb displayed you should use this in preference to the ID, as it's possible for the ID number to change if additional context menu extensions are installed.
You can see from this example that the Restore previous versions command has a verb (PreviousVersions) whereas the Show Versions command only has an ID.
Once you know what the verb or ID is for the command you want to automate, you can configure your button or hotkey with the appropriate ContextMenu command.
Command Arguments:
Argument |
Type |
Possible values |
Description |
---|---|---|---|
CTRL |
/S |
(no value) |
When invoking a context menu command, tells the command handler to act
as if the Ctrl key is held down. What difference this makes (if any) is up
to the handler. |
EXTENDEDVERBS |
/S |
(no value) |
Enables support for extended verbs. These are
context menu commands that are normally only displayed when the
Shift key is held
down. |
FILE |
/K/M |
<filename>, ... |
Specify the file or files to operate on. If not specified the
command will operate on all currently selected files. |
ID |
/K/N |
<command ID> |
Specify the ID of the context menu command to execute. |
ITEMMODE |
/S |
(no value) |
(Windows Vista and above. Has no effect on Windows XP.) |
LABEL |
/K |
<label> |
Specify the label of the context menu command to execute. |
LOOKUP |
/S |
(no value) |
Use in conjunction with the VERB argument to make Opus
lookup the verb's ID on-the-fly instead of simply passing the verb name to
the command handler. You should not normally have to do this but some
context menu handlers have bugs that prevent them from doing the lookup
themselves. |
REGEXP |
/S |
(no value) |
Used in conjunction with the LABEL argument to specify
that the label string is a regular
expression. |
SHIFT |
/S |
(no value) |
When invoking a context menu command, tells the command handler to act
as if the Shift key is held down. What difference this makes (if any) is
up to the handler. If you use this then you'll probably also want to use
EXTENDEDVERBS as holding down the shift key also normally
causes the extended verbs to be shown, and the menu handler may expect
both to be used
together. |
SHOWCMDS |
/S |
(no value) |
Displays a list of context menu commands for the selected files.
Depending on the context menu handlers installed on your system, the list
of commands you get back may differ based on the
EXTENDEDVERBS and ITEMMODE arguments; if
you use either of them when finding a command then you should do the same
when running that
command. |
VERB |
default |
<verb> |
Specify the verb of the context menu command to execute. This is the
default argument for the ContextMenu command, so the
keyword VERB does not need to be
specified. |
WANTSYNC |
/S |
(no value) |
Requests that the context menu command be run synchronously. In other
words, any other commands should wait until the context menu command has
completed, instead of running in parallel. This is just a request and the
context menu handler may ignore it. Similarly, context menu handlers may
choose to run things synchronously even when this argument is not
specified. |
WILD |
/S |
(no value) |
Used in conjunction with the LABEL argument to specify
that the label string is a wildcard
expression. |