Your prescription for increased productivity and profitability
In this week’s blog post we take a step backward to review creating a keyboard shortcut to launch a script.
If you want to follow along with this post you will want the script that we created in our previous blog post: Web Document from Preset. You can get the script from our Feature page. If you don’t want to download the script, you can use the code below that is a cutdown version. This script does no more than create a web document from a document preset that has web intent (no added automation; no custom dialog.)
--assumes a preset having web intent exists set userPrompt to "Choose Preset for creating a web document" tell application "Adobe InDesign CC 2018" set presetList to name of document presets where intent is web intent try set userChoice to my getChoice(presetList, userPrompt) set docRef to make document with properties {document preset:userChoice} on error errStr activate display alert ("Error: " & errStr) end try end tell userChoice on getChoice(choiceList, userPrompt) set userChoice to choose from list choiceList with prompt userPrompt if userChoice = false then error "User Cancelled" else return item 1 of userChoice end if end getChoice
Now that you have a script, put it to work using a keyboard shortcut. The steps for this will be as follows:
InDesign has two locations for saving scripts, the Application folder and the User’s folder. To see where these folders are located:
…Scripts panel with folders for scripts
Get the Path to the Folder
Control-Click (Right-Click) on the Application folder listing and select Reveal in Finder to see the path to the folder. (You will want to have Finder’s folder display in columnar view.)
…Click Reveal in Finder to see path to selected item
The path to the Application scripts folder is inside InDesign’s Application folder (Finder’s columnar view).
…Path to the Appiication’s scripts folder
The Keyboard Shortcut dialog is opened from InDesign’s Edit menu.
…the Keyboard Shortcut dialog
..Warning appears if shortcut is already assigned
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 and enter the keyboard shortcut.
Your new document will be created. You are now ready to complete your masterpiece. If you used our Feature page script you can also take advantage of the layers that were created and the styles you imported. Layers can be used to organize your document, and the styles selected for import will be ready to use possibly with little or no modification.
In the next blog post we will look at creating stylesheets, along with some of the ways they can be used to make document creation even more automated.
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.