How to Install a Script in InDesign That You Found in a Forum or Blog Post
If you find a script that is just text (not a downloadable file), how do you install it?

This has bugged novice InDesign users for years: You find a script on a forum thread or a blog post, but it’s just text… that is the scripter has pasted the text of the script in, so you can actually see the code. For experienced users (and scripters), that’s no big deal. But if you want to use that script, but you don’t know what to do with the code, read on.
By the way, if you find a script and can download it (it’s a downloadable .jsx or .zip file) then you need to read this other blog post about how to install it. Also, in the vast majority of cases the code you find will be written in javascript (technically called “extendscript”). However, if you think it’s AppleScript or VBscript, then these instructions will not work. We’ll try to do another blog post about those some other time.
Okay, you see a bunch of code and you want to run it in InDesign.
1. Copy the Script. You need to copy the text. On some web pages, there will be a “Select Code” button for your convenience (just click it and it selects all the code). Otherwise, just drag over the code text and copy it to the clipboard. Make sure you get it all — dropping even a single character can often mean the difference between success and failure.
2. Paste the Script. You need to save the script into a text-only file. You could paste the code into the Adobe Extendscript Toolkit application, but that’s overkill unless you’re planning on doing scripting yourself. Instead, paste it into a text-editor, such as TextWrangler (my favorite free text editor for the Mac), or TextEdit, or NotePad on Windows. Just make sure that you’re in text-only mode, so there’s no formatting (font, styles, and so on).
3. Save the Script. When you save the script to disk, it must have a .jsx file name extension (not .txt). You can save it to disk anywhere you want, such as the Desktop, My Documents, or some other folder.
4. Move the Script into Position. In order for InDesign to see and use the script, it has to be in one of two places. To find that “right place,” switch back to InDesign temporarily and open the Scripts panel (it’ll be in the Window menu; in CS5 or later, it’s tucked in the Utilities submenu). You’ll see two folders listed in the Script panel: Application and User. I almost always store my scripts in the User folder because they’re “my” scripts. So right-click (or Control-click with a one-button mouse) on the User folder and choose Reveal in Finder from the Context menu (or Reveal in Explorer in Window). That opens a folder on your desktop in which you’ll find a folder called Scripts Panel. Move your script into the Scripts Panel folder. Any script inside the Scripts Panel folder will appear in the Scripts panel.
5. Run the Script. That’s it! Now you can switch back to InDesign and you should see your newly-saved script inside the User folder. (You may have to click the expanding triangle next to the folder name to see it.) You can run it by double-clicking it.
If the script doesn’t work for some reason, go back to the file and:
- make sure it’s truly a text-only file
- make sure any quotation marks (single or double) are straight quotes and haven’t accidentally been turned to curly quotes
- make sure you copied all the script properly
- make sure you’re running the script properly (for example, some scripts require a frame to be selected before they do anything; others need a document open, or no documents open, and so on).
- in some cases, part of the script will have been messed up by the web site formatting. For example, some characters may have been munged, deleted, or changed in the HTML. In this case, there’s little you can do except see if someone has commented on a fix (check the original web site for comments), or contact the script writer. Posting scripts can be a tricky business because each and every character counts!
Hey, Anne-Marie Concepcion also showed how to do this (with even more details) in her InDesign Secrets video “Running a Script” at lynda.com!
This article was last modified on December 21, 2021
This article was first published on January 11, 2012