How to Auto-Run Scripts on File Open in Photoshop
Automating tasks in Adobe Photoshop saves significant production time, especially when standardized operations need to occur the moment an image is launched. By using Photoshop’s built-in Script Events Manager, users can bind custom JavaScript or ExtendScript files to specific application triggers, such as the "Open Document" event. This guide outlines the exact setup required to automatically execute a custom script every time a file is opened in Photoshop.
Accessing the Script Events Manager
The configuration begins inside Photoshop's scripting utility:
- Launch Adobe Photoshop.
- Navigate to the top menu and select File > Scripts > Script Events Manager.
Configuring the Event Trigger
Once the Script Events Manager dialog box appears, follow these steps to link your custom script to the file-opening process:
- Enable Script Events: Check the box labeled Enable Events to Run Scripts/Actions at the top of the dialog window. If this option is disabled, no configured events will execute.
- Select the Photoshop Event: In the Photoshop Event dropdown menu, select Open Document. This designates the trigger that fires whenever any supported file is opened in the workspace.
- Select Your Script: Under the
Script radio button, open the dropdown menu. If your
script is already installed in Photoshop’s presets directory, select it
from the list. If it is stored elsewhere, choose
Browse... to navigate to your custom
.jsxor.jsfile on your local drive. - Register the Event: Click the Add button located on the right side of the dialog. The event pairing will appear in the active event list below, confirming that the "Open Document" action is now tied to your selected script.
- Apply Settings: Click Done to close the window and save the configuration.
Testing the Automation
To confirm the setup is working correctly:
- Open any image file via File > Open or by dragging a file into the Photoshop workspace.
- Observe the execution of your script. If written correctly, the script's logic will run immediately after the document canvas initializes.
Managing or Removing the Event
If you need to edit or stop the script from running automatically:
- Return to File > Scripts > Script Events Manager.
- Select the existing event from the list at the bottom of the dialog.
- Click Remove to delete the association, or uncheck Enable Events to Run Scripts/Actions to globally pause all event triggers.
- Click Done to apply the changes.