Automating Adobe InDesign 2019 - AppleScript


Keyboard Shortcut for Scripts

Tuesday, January 08, 2019

Creating a Keyboard Shortcut

Do you have a script that you use often? Give it a keyboard shortcut to save yourself trips to InDesign's Script's panel. 

Save Your Script

Once you get a script working the way you want it, save it to one of InDesign's folders designated specifically for scripts. Where is that? you may ask. Here's the trick:

If you open the Script Panel in InDesign (Window > Utilities > Scripts) you will see that there are two main divisions: Application and User.

Script panel showing two folders...Script panel with folders

Inside the Application Folder there is a subfolder named Samples. (If you haven't played with the scripts inside the Samples folder, you are missing out on some great time-saving scripts.)

If you haven't saved a script to the user's folder it will be empty.

You can place a script in either of the two locations. Let's explore:

Application Folder

Only a person with administrative privileges can add a script to the Application folder in the Scripts panel.

All users can access a script in the Application folder to use, read and/or copy (duplicate) the script, but they cannot change the script. Only a person with administrative privileges can change the script.

User Folder

Scripts in the User folder are open for use, read, and edit by the user who is currently logged into the computer. If you don't have administrative privileges, or you simply don't like having to type in your password just to make a simple change to a script, you may decide the User folder is the one for you.

Put Your Script To Work

Now that you have decided on the folder for your script, let's put it to work with a keyboard shortcut. The steps for this will be as follows:

  • Add the script to the folder
  • Create a Keyboard Shortcut to launch the script
  • Launch the Script using the Keyboard Shortcut

Add script to the folder

When you Control_Click (Right-Click) on either the Application or User folder inside the Script panel listing. you get a popup with only one option: Reveal in Finder

Reveal in finder option when folder right-clicked...Reveal in Finder

Click on the option to open the Finder's choose window. The Scripts Panel will be selected. If in Columnar view you can see the folder path that leads to the Script folder you selected. The path to the Application is easy to trace.

path to Application's scripts folder...path to the Application Script Panel folder

Double-click on the highlighted Scripts Panel folder to open its list. Drag your script into the list. That's it. Now you can double-click on its entry from inside InDesign to take advantage of all that hard work creating the script .

Create a Keyboard Shortcut

Rather than launching the script from InDesign's Script panel, use a keyboard shortcut.

The Keyboard Shortcut dialog is opened from InDesign's Edit menu.

Keyboard Shortcut dialog window...Keyboard Shortcuts dialog

  1. Create a Shortcut Set for your Scripts
    If you don't have a set established for your scripts, click the New Set button Enter a name for your script collection (set) in the dialog presented. Otherwise, select a set from the Set dropdown.
  2. Product Area Dropdown
    Select scripts for the Product Area.
  3. Select your Script
    The scripts menu shows a list of all scripts in the Application and User folders. The Application folder is at the top; further down you will find the User folder.
  4. Click on the listing for the script you added
    When you find your script, click on it.
  5. Add Shortcut
    In the New Shortcut field, add the keyboard shortcut you want to assign to the script. Most of the Command+key options are all taken. However, you will find the Option+Shift+key and the Control+Option+key combination has a lot of options available.Shortcut Already assigned warning...Warning appears if shortcut is already assigned
  6. Assign Context
    You may want to keep most of your scripts available for the Default Context mode but should you have a wealth of scripts for working with tables for instance, you may want to assign the tables context to these scripts.
  7. Assign the Shortcut
    Once you have entered a keyboard shortcut that is not already assigned, click the Assign button to assign the shortcut to the script.
    Shortcut for script assigned...Script assigned
  8. Click OK
    You can assign any number of shortcuts to scripts before clicking the OK button. When you have no other scripts to assign, click the button.

Launch the Script

Back in InDesign, if you reopen the Scripts panel, you should see the keyboard shortcut you have assigned to the script as part of its listing.

Now that you have assigned a shortcut to the script, try it out. Make sure InDesign is frontmost. In the active document select a page item or items as needed for the script, and enter the keyboard shortcut. Pat yourself on the back thinking of all the time this little keyboard shortcut and script will save you.

Upward and Onward

In the next blog post we will look at building custom dialogs, along with an example script to make working in InDesign even more automated.

Disclaimer

Scripts are provided for demonstration and educational purposes. No representation is made to their accuracy or completeness. Readers are advised to use the scripts at their own discretion.

Trackback Link
http://www.yourscriptdoctor.com/BlogRetrieve.aspx?BlogID=18424&PostID=1528261&A=Trackback
Trackbacks
Post has no trackbacks.