Adobe 65007312 Programming Guide - Page 26
The loader environment, Using ZStrings for Localization
UPC - 883919154398
View all Adobe 65007312 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 26 highlights
CHAPTER 2: Writing a Lightroom Plug-in Writing standard plug-ins for Lightroom 26 LrMetadataProvider Optional table of tables Adds custom metadata fields, available only in Lightroom. There can be only one such item in a plug-in. It contains a string, the name of the Lua file (metadata definition script) that defines the fields. See "Adding custom metadata" on page 68. Can be combined with other services (export services, export filters) or can be the only service provided by the plug-in. Ignored in any Lightroom version older than 2.0. LrMetadataTagsetFactory Optional table of tables Adds a tagset of predefined metadata fields. The user can select defined metadata tagsets from a menu in the Metadata panel. Some tagsets are supplied by Lightroom; this allows your plug-in to supply additional tagsets. See "Adding custom metadata tagsets" on page 73. Ignored in any Lightroom version older than 2.0. LrAlsoUseBuiltInTransla- Optional tions Boolean Controls behavior of built-in LOC function. When true, strings that are not found in the plug-in's translation file are checked against Lightroom's translation file for the current language. Note that string keys are not guaranteed to remain the same across version releases. Ignored in any Lightroom version older than 3.0. The loader environment The Info.lua file is a special Lua environment that is much more restrictive than the general SDK Lua environment in which other scripts run. X The standard Lua namespace string is available, and you can use the LOC function for localization of display strings in this file (see Chapter 7, "Using ZStrings for Localization"). X You can use WIN_ENV and MAC_ENV environment variables, and the _VERSION variable that contains most of the version information otherwise available through LrApplication.versionTable(). However, you cannot use any of the other Lua or Lightroom globals defined in the SDK scripting environment, (see "The Lightroom SDK scripting environment" on page 12). For example, you cannot use import or require in this context. Here is an example of an Info.lua file for a plug-in that adds items to the Lightroom menus: return { LrSdkVersion = 3.0, LrSdkMinimumVersion = 1.3, -- minimum SDK version required by this plug-in LrToolkitIdentifier = 'com.adobe.lightroom.sdk.helloworld', LrPluginName = LOC "$$$/HelloWorld/PluginName=Hello World Sample", -- Add the menu item to the File menu.