Triggering a script using a keyboard shortcut

Often times, you'll want to trigger a script using a keyboard shortcut rather than navigating the File>Scripts menu.

Here's how you do it:

First, locate the Actions Palette. If it's not visible, choose from the menu Window>Actions. Click the new 'Create New Action' button.

Name the action and choose the keyboard shortcut. I named mine 'Jeffs_automated_task.js',the same as the script we'll be calling, and chose 'F2' as my keyboard shortcut. Then, choose Record.

Next, we'll point to the script we want to run when we press 'F2'.

Choose 'Insert Menu Item' from the Actions Palette fly-out menu.

The 'Insert Menu Item' dialog appears.

Go to the 'File' menu and navigate to the the script you want to run. Choose: File>Scripts>Jeffs_automated_task.js.

Click 'OK".

Stop recording, by clicking the 'Stop Playing/Recording" button on the Actions Palette.

You're all set. Now any time you press 'F2,' Photoshop will run the script.

To change the keyboard shortcut, double-click the action or choose "Action Options" from the Actions Palette fly-out menu.