Table of Contents

Introduction
Who Should Read This?
How Does It Work?
Download(s)
System and Software Requirements
Adobe Photoshop Reserved Words

Tutorials
Overview
  1. Starting a Flex Project
  2. Hello World Panel
  3. Placing the CSXS Library

  4. Shortcut Buttons Panel
    1. JavaScript
    2. Design the Panel
    3. ActionScript
    4. Photoshop Persistent
    5. CSXS Logger AIR Debugger (Optional)

  5. Setting Up Script Listener

  6. Color Picker Panel
    1. JavaScript
    2. Design the Panel
    3. Find Character ID Code to Register Events
    4. ActionScript
    5. Create Custom Icons

  7. Flickr Search Panel
    1. Design the Panel
    2. Create a Flickr Service
    3. Design a Custom Module
    4. Modify Panel's Properties
    5. Connect on Preferences

  8. Per Layer Metadata Panel
    1. View Metadata
    2. JavaScript
    3. Find Character ID Code to Register Events
    4. Designing the Panel
    5. ActionScript
    6. Using Photomerge
Other Samples
Best Practices
Frequently Asked Questions
Acronyms and Definitions
Links
Adobe® Photoshop® Panel Developer's Guide

Shortcut Buttons Panel: Photoshop Persistent

The fourth part of the Shortcut Buttons Panel is creating an Photoshop Persistent call. The result is allowing the Adobe Photoshop Panel to continue running and communicating to Adobe Photoshop even if it is closed or minimized.

Instructions:

  1. The red colored text are the changes made to the init function in ShortcutButtons.mxml:
    public function init():void{
       CSXSInterface.instance.evalScript("PhotoshopPersistent");
       newDocTimer.addEventListener(TimerEvent.TIMER,newDocTimeHandler);
       closeDocTimer.addEventListener(TimerEvent.TIMER,closeDocTimeHandler);
       newDocTimer.start();
       closeDocTimer.start();
    }		

    Code Walkthrough: Adding CSXSInterface.instance.evalScript("PhotoshopPersistent"); to the init function will allow the Shortcut Buttons Panel to continue communicating with Adobe Photoshop even when the panel is closed. Note: For more information about PhotoshopPersistent, see Adobe Photoshop Reserved Words.

  2. Go to Run > Run ShortcutButtons to preview the design area in the web browser.
    Note: The buttons and checkboxes will not work in the web browser because the target is Adobe Photoshop.
  3. Close the web browser.
  4. Close Adobe Flex Builder.
  5. Open the ShortcutButtons folder on the desktop.
  6. Open the bin-debug folder.
  7. Copy ShortcutButtons.swf into the Panels folder under the Adobe Photoshop CS5\Plug-ins\ folder located under:
    • Applications for Macintosh
    • Program Files for Windows
  8. Copy ShortcutButtons.jsx from the Panels folder into the bin-debug folder under the ShortcutButtons folder on the Desktop.
  9. Open Adobe Photoshop.
  10. Go to Windows > Extensions > ShortcutButtons.
  11. The Shortcut Buttons Panel opens as a panel like seen below:
  12. The Shortcut Buttons Panel has two buttons and two checkboxes in which the user can create a new document and close a current document manually by clicking on the buttons or automatically on a timer. When the Shortcut Buttons Panel is closed or minimized, communication to Adobe Photoshop will continue if the two check boxes are marked.
Continue to CSXS Logger AIR Debugger (Optional)