Adobe 65007312 Programming Guide - Page 168
Getting Started: A Tutorial Example, Creating an export plug-in, Create the information file
UPC - 883919154398
View all Adobe 65007312 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 168 highlights
9 Getting Started: A Tutorial Example This chapter will help you get started with extending Lightroom's Export behavior by walking through the creation of the simple Hello World plug-in. This plug-in adds menu items to the File and Library menus, and defines dialog boxes that are displayed when the menu items are selected. The plug-in also demonstrates how to output and view trace information for debugging and development. This chapter shows how to build plug-ins that extend the Export functionality of Lightroom. The concepts and techniques are explained in more detail in Chapter 3, "Creating Export and Publish Services." X Additional features you can add using the same framework are demonstrated in Chapter 10, "Defining Metadata: A Walkthrough." X Web Gallery plug-ins, which use a different framework, are demonstrated in Chapter 11, "Web Gallery Plug-ins: A Tutorial Example." Creating an export plug-in You can place a plug-in folder anywhere, and notify Lightroom of its location using the Plug-in Manager. A plug-in must be packaged for delivery within a single folder, with the suffix .lrplugin. For development, you can use the suffix .lrdevplugin. Thus, the Hello World plug-in will be placed in the folder helloworld.lrdevplugin. Create the information file 1. Create a text file and save it as helloworld.lrdevplugin/Info.lua. You must describe your plug-in to Lightroom by creating an Info.lua file and placing it in your plug-in folder. This script must return a table that describes the plug-in to Lightroom. 2. Edit the script in the information file to return a table. This table must contain the version number for the SDK and a unique string to identify the plug-in. Add the following code to the Info.lua file: return { LrSdkVersion = 3.0, LrToolkitIdentifier = 'com.adobe.lightroom.sdk.helloworld', } 3. Add another entry to the returned table to create a menu item in the Lightroom File menu. Place the following code after the LrToolkitIdentifier entry: LrExportMenuItems = { title = "Hello World Dialog", -- The display text for the menu item file = "ExportMenuItem.lua", -- The script that runs when the item is selected }, (This entry adds only one menu item, so it defines a single table, rather than a table of tables.) 4. Add another entry to the returned table to create a menu item in the Lightroom Library menu. 168