C
2: Writing a Lightroom Plug-in
HAPTER
file
enabledWhen
In Windows, the title string can include an ampersand (
character a keyboard shortcut or accelerator that invokes that item. (This feature is not available in Mac OS;
on that platform, the
For example, suppose the table returned by your
LrExportMenuItems = { title = 'My &Plugin', file = 'somefile.lua' }
This would create a command in the File > Plug-in Extras menu with the label "My Plugin". The command
would execute the script found in
The user can invoke this command using the keyboard accelerator sequence A
A
F brings up the File menu
LT
S is the keyboard accelerator for the Plug-in Extras submenu
P is the keyboard accelerator for the new command
(String) The name of the Lua file (service definition script) to be executed when the menu
item is chosen. See
"Defining an export service" on page
(String, optional) A condition under which to enable this menu item. One of:
photosAvailable
grid.
: Item enabled when any photos are selected. Ignores videos.
photosSelected
: Item enabled when any videos are selected. Ignores still photos.
videosSelected
anythingSelected
If the selection is very large (>5000 photos), menu items are enabled regardless of this
value.
character is automatically removed if present.)
&
somefile.lua
: Item enabled when any photos or videos are available in the
: Item enabled when any photos or videos are selected.
) character in the name to make the following
&
file contains this item:
Info.lua
.
Defining menu items for a plug-in 34
35.
F + S + P.
LT