![]() |
Adobe Photoshop SDK |
|
Writing Export Plug-insExport plug-in modules are used to output an image from an open Photoshop document. Export modules can be used to print to printers that do not have Mac OS Chooser-level driver support. They can also be used to save images in unsupported or compressed file formats, although File Format modules often are better suited for this purpose. File Format modules are accessed directly from the Save and Save As commands, whereas Export modules use the Export sub-menu. For descriptions of the sample Export plug-ins provided with the SDK, see Export Samples. When the user invokes an Export plug-in by selecting its name from the Export submenu, Photoshop calls it with the sequence of selector values shown in the figure below. The actions the Export plug-in needs to take for these selectors are discussed in more detail in Export Module. ![]()
Export Modules and ScriptingThe scripting system passes its parameters at every selector call. While it is possible to use the scripting system to store all your parameters, for backwards compatibility, it is recommended you track your parameters with your own globals. Once your globals are initialized, you should read your scripting-passed parameters and override your globals with them. The most effective way to do this is:
This way, the scripting system overrides your parameters, but you can use the initial values if the scripting system is unavailable or has parameter errors, and you can use your globals to pass between your functions. Scripting at exportSelectorFinishIf your plug-in is scripting-aware and it has changed any initial parameters, it should pass a complete descriptor back to the scripting system in the Advance State and Export ModulesThe AdvanceStateProc can be called from either |