You are on page 1of 14

How to Install a Script in InDesign That You Found in a Forum or Blog Post | InDesignSecrets

username login help

Search

Articles Magazine Events Resources Watch & Listen Shop Forums Membership

Beginner's Corner Plugins and Scripts


SIGN UP FOR THE INDESIGN
How to Install a Script in InDesign TIP OF THE WEEK
That You Found in a Forum or Blog
Email... * Go
Post
David Blatner January 11, 2012

21 Comments Share This

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,

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php[26-Oct-15 8:33:15 AM]


How to Install a Script in InDesign That You Found in a Forum or Blog Post | InDesignSecrets

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.

CURRENT PODCAST

2. Paste the Script. You need to save the script into a text-only file. InDesignSecrets
You could paste the code into the Adobe Extendscript Toolkit Podcast 226
application, but that's overkill unless you're planning on doing
September 30, 2015 3:50
scripting yourself. Instead, paste it into a text-editor, such as
pm
TextWrangler (my favorite free text editor for the Mac), or TextEdit,
News:
or NotePad on Windows. Just make sure that you're in text-only
InDesign Tips
mode, so there's no formatting (font, styles, and so on). atAdobe MAX2015

Our latest new


InDesigntitles at
Lynda.com
Gearing up for the
InDesign Conference
and the Photoshop
Conference!

Interview with Erica


Gamet
Publish Online feature:

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php[26-Oct-15 8:33:15 AM]


How to Install a Script in InDesign That You Found in a Forum or Blog Post | InDesignSecrets

Pros, Cons, and more


Ranting about the CC App
Obscure InDesign Feature
of the Week: Show
Content Offset

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 Past Subscribe
Episodes
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 Recent Recent
place," switch back to InDesign temporarily and open the Scripts comments Forum
panel (it'll be in the Window menu; in CS5 or later, it's tucked in the Posts
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
Recent
with a one-button mouse) on the User folder and choose Reveal in Comments
Finder from the Context menu (or Reveal in Explorer in Window).
Alastair Leith said about
That opens a folder on your desktop in which you'll find a folder
How to Find the Font That
called Scripts Panel. Move your script into the Scripts Panel folder.
Has the Glyph You Need:
Any script inside the Scripts Panel folder will appear in the Scripts
Hey Steve, OT but I've twice
panel.
filled the
Queenie said about Multi-
Level Automatic
Numbering in InDesign:
Hello, Thank you for your
helpful post. I
Wilhelm said about
Formatting Headings for
Inclusion in a Table of
Contents:
I've been fighting a character
5. Run the Script. That's it! Now you can switch back to InDesign

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php[26-Oct-15 8:33:15 AM]


How to Install a Script in InDesign That You Found in a Forum or Blog Post | InDesignSecrets

style on my
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!

Bio
Latest Posts

David Blatner
David Blatner is the co-founder of the Creative
Publishing Network, InDesign Magazine, and the
author or co-author of 15 books, including Real World
InDesign. His InDesign videos at Lynda.com are
among the most watched InDesign training in the
world. You can find more about David at 63p.com.

TAGS

automation installing javascript Scripting

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php[26-Oct-15 8:33:15 AM]


How to Install a Script in InDesign That You Found in a Forum or Blog Post | InDesignSecrets

RELATED ARTICLES

New Contest! The Ultimate Fix for


Overset Text
by Mike Rankin

Tip of the Week: Access Grids and


Guides in the Application Bar
by Mike Rankin

Why Does My High Res Image Look


Low Res?
by Eugene Tyson

COMMENTS


21 Comments on How to Install a Script in
InDesign That You Found in a Forum or Blog
Post

Stphane B.
January 11, In an other way, you also could use Script Bay to
2012 test and save the script.
at 11:14 am
http://in-tools.com/article/script-bay/script-bay-version-
0-1-5/

Using the Script Bay with Editor configuration (last


screenshot), you could paste the script, test it and
name it directly inside InDesign (or PS, AI?) without
having to find the exact folder location and without
restarting InDesign:
http://in-tools.com/article/script-bay/script-panel-
replacement-for-the-entire-creative-suite/
Reply

Marc Autret
January 11, Hi David ;-)
2012

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php[26-Oct-15 8:33:15 AM]


How to Install a Script in InDesign That You Found in a Forum or Blog Post | InDesignSecrets

at 11:31 am Thanks to mention that small snippet as an example.


Unfortunately?I am ashamed!?there was a typo in my
script, so there is a typo in your screenshot.

We should replace


doc.facingPages
dpf.facingPages
&&
by &&

. . .
. . .

Sorry about that.

@+

Marc
Reply

David Blatner
Post author @Stphane: Excellent point! Thank you!
January 11,
2012 @Marc: No problem. It is fixed in that other blog post
at 11:43 am where you typed it.
Reply

John
Hawkinson Hey, guys. Thanks for the reprise of
January 11, indesignsecrets.com/how-to-install-scripts-in-
2012
indesign.php. This one is better done!
at 11:40 pm

But Im afraid I think Dan Rodney still did a better job


with http://www.danrodney.com/scripts/directions-
installingscripts.html. Those inline images make all
the difference! Consider cribbing :)

I want one good URL to point people to!


Reply

Magne
Hjertaker Great article! Didnt know this was so easy. Thank
January 12, you!
2012
at 1:35 am
Reply

Marcel
January 13, Step 0 is to read other peoples comments and al least

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php[26-Oct-15 8:33:15 AM]


How to Install a Script in InDesign That You Found in a Forum or Blog Post | InDesignSecrets

2012 skim read the script itself . Remember ExtendScript


at 3:31 am
can access your filesystem, download from internet
or send anything out to internet, thus capable of
anything rangigng from innocent pranks to nasty
stuff.

Speaking of scripts, heres one that alows you to


downsave to lower version, allows footnotes work
with tables, walks your dog every morning and cook
you breakfast.

You may try it yourself. Only dont forget to apply step
0 I suggested

Marcel

[[editors note: we removed this dangerous script.


@marcel: while you make a very good point (that you
should know what a script does, trust the scripter,
and read all comments before you blindly run it),
theres no reason to actually provide a script that will
cause damage here.]]
Reply

Jongware
January 13, Yeah Marcel, your advice of applying step 0 will
2012 only work for those who know both Javascript and
at 4:19 am
AppleScript, and who know what the shell does in
Mac OS X, and who know what the rm command
does. Everyone else that tries it just to see what
happens will encounter a Very Nasty Surprise of the
Serious Kind.

Do Not Try Marcels Script For Fun. Dont. Dont.


Dont.

(See wikipedia on rm -rf for what this command


would do!)
Reply

Jimmy
Hartington I would also mention Notepad++ as a good and free
January 13, text-editor for Windows.
2012
at 5:01 am
Reply

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php[26-Oct-15 8:33:15 AM]


How to Install a Script in InDesign That You Found in a Forum or Blog Post | InDesignSecrets

@Jongware: Thanks for the heads up on that script.


Its gone now. I have actually never seen a scripter in
David Blatner
Post author
the InDesign community post a dangerous script like
January 13, that, but I suppose one must be careful scripts are
2012 software, and though they usually only control
at 7:21 am InDesign (in this case), they can potentially reach out
farther, especially when calling AppleScript or
VBScripts.
Reply

.. they usually only control InDesign (in this case) ..



David, not in this case. This script would have
Jongware
January 13,
executed an OS shell command that removes every
2012 file on every storage unit within its reach in your
at 8:40 am entire system (i.e., connected back up disks, floppy
disks, network drives, USB sticks, etc.).

Sorry Marcel, Im quite certain you purely meant to


joke, but Im equally certain it would have been no
laughing matter for some.
Reply

@Jongware: Sorry, I was not clear with my comment.


Yes, I understood that this javascript would run an
David Blatner
Post author
applescript. I meant that its very rare to see
January 13, javascript (extendscript) scripts on forums or blog
2012 posts like this that trigger applescripts or other
at 9:40 am scripts.

For anyone reading this who is nervous about scripts,


I think the lesson from Marcel is: if youre unsure
about a script, then wait to see when someone
responds to the script saying this is great! :)
Reply

I probably shouldnt have posted that snipped here,


athough it had a safety brake and would crash before
Marcel

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php[26-Oct-15 8:33:15 AM]


How to Install a Script in InDesign That You Found in a Forum or Blog Post | InDesignSecrets

January 13,
doing any harm on anyones but my own system
2012 (missing library).
at 10:18 am
I wanted it to illustrate that you can spot suspicious
code even without scriping knowledge.

If the script promises to cook you breakfast and
theres nothing of the sort in it then its suspcious.

Anything like app.doScript or Socket in standalone
downloaded script can mean its a malicious script.

other signs of malicious scripts (on top of Socket &


app.doScript):

huge dense block of text

any ocurence of eval especialy something like
eval(LONGNONSENSICALLMUMBOJUMBOSPANN1N

But Scripts dont have to be malicious to cause


damage. Simple app.save() after some error in the
middle of the script run on the original document can
ruin your day/job position.
Reply

@Marcel: True enough! Its good to be safe.

David Blatner But I just want to reiterate (for everyone else reading
Post author this) that in many years I have never run into an
January 13,
InDesign script offered by a reputable person that
2012
causes significant damage. Sometimes they dont
at 10:26 am
work and need debugging, but thats not terrible.

That said, it is a Very Good Idea to save your


documents often, make backups from time to time,
and perhaps even save your file before running a
script.
Reply

Heather
June 5, 2012 Upgraded InDesign CS6 from Adobe Cloud, and it
at 10:19 am appeared to pull scripts from previous versions. In my
Finder my script appear to be there, but does not
show up in my Script Window users folder.

When it runs in Script Toolkit, it errors on

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php[26-Oct-15 8:33:15 AM]


How to Install a Script in InDesign That You Found in a Forum or Blog Post | InDesignSecrets

/*void*/ LayoutWindow.prototype.permuteSelected =
function()

saying LayoutWindow is undefined.

It shows up in the proper place


User/Library/Pref/Adobe InDesign/Scripts Panel

but does not show in my users folder in script
window.

I dont write scripts, so have no idea where to fix. I
have fallen in love with this script, and really would
love to have it back in my daily workflow.

Any help would be appreciated.
Reply

Denise
February 15, THANK YOU! This was exactly what I needed. So
2013 appreciated.
at 8:38 am
Reply

Dan
May 15, 2013 Woohoo! Thanks! I was really lost.
at 3:48 pm
Reply

VC
June 6, 2013 This is my first experience with InDesign and my first
at 11:45 am attempt at using a script. Can anyone tell me how
much of the JSX text to keep in the file? I found a
MOO Script for making MOO Cards in InDesign. I
havent figured out how to get it to run and MOO said
maybe Adobe can help. I see now that my
downloaded file was converted to moo.jsx.txt so I just
changed it to moo.jsx

Here is the link for the jsx file which MOO links to:
https://raw.github.com/moodev/moo-
indesign/master/moo.jsx

The script has a Header of sorts which begins with
a long line of dots (below). After that it starts with
#target indesign. Where does the actual script
begin??? and should the whole thing stay in the jsx
file after downloading? Sorry Im a newbie, but want
to get this working.

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php[26-Oct-15 8:33:15 AM]


How to Install a Script in InDesign That You Found in a Forum or Blog Post | InDesignSecrets

//*-
javascript -*-

//

// moo.jsx

//

// an InDesign script to assist in the creation of MOO
Business Cards

//

// (c) MOO Print Ltd 2012

//

//


//

// includes the following third-party libraries (see
below for licences):

//

// OAuth (c) Netflix, Inc. 2008

// SHA (c) Brian Turek 2008-2010

// JSON Douglas Crockford (Public Domain)

//

//

#target indesign

#targetengine session

(function() {

var API_HOST = uk.moo.com;
Reply

Joris
October 31, Sorry to bother you this late, but Ive a problem.
2014 Similarly to what Heather reports, the scripts arent
at 3:06 am
showing up in my Scripts panel.

They dont show up immediately like they should.

They dont show up after a reboot.

They dont show up after deleting the preferences.

Tried three different scripts. No errors when I open
them with the Extendscript Toolkit. They have the
right file extension as well. All scripts should work
with my version of InDesign.

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php[26-Oct-15 8:33:15 AM]


How to Install a Script in InDesign That You Found in a Forum or Blog Post | InDesignSecrets


The pre-installed scripts show up just fine, doesnt
appear to be a graphics problem.

Im using InDesign CS5.5 (7.5.3) on Windows 7
Pro. Its a shared computer with password-protected
accounts, but I dont see any restrictions in using or
configuring it.

Anybody know what Im doing wrong here?


Reply

Joris: Im guessing that you are putting them in the


wrong folder. For example, if you have more than
David Blatner
Post author
one version of InDesign installed, there will be
October 31, more than one Scripts Panel folder. Try the Reveal
2014 in Finder/Explorer trick explained in the article
at 6:14 am above to ensure you have the right one. Also,
ensure that the scripts go into the Scripts Panel
folder, not the Scripts panel.
Reply

Hi David,

Yes, I used the Reveal in Explorer from the
Joris
October 31,
Scripts panel way. But I completely overlooked
2014 the repeated instruction to put it into the
at 6:23 am SCRIPTS PANEL FOLDER. Apparently my
expectation to immediately get to the right folder
when right-clicking has made me lazy.

In short: youre right! Seems okay now. Thanks


for the quick reaction!

Jeremy
November 18, I absolutely love this script, I added pages above each
2014 calendar page to make a photo calendar, my ONLY
at 8:46 am
question, is now for next year, how do I just change
the dates, without having to go back and do all the
work of adding the pages, sizing the images, etc.
Thank you!
Reply

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php[26-Oct-15 8:33:15 AM]


How to Install a Script in InDesign That You Found in a Forum or Blog Post | InDesignSecrets

Leave a Reply

Your email address will not be published. Required fields are marked
*

Name *

Email *

Website

Comment


Notify me of followup comments via e-mail

Post Comment

InDesign Secrets About the Site Resources


About Us Blog Archives Books and Videos
Contact Us Membership Events
Write for Us Forums InDesign Magazine
Speak at Our Events InDesign FAQ Store
Advertise Training & Consulting
Privacy Policy Our guide to discovering
Terms of Use
all the

great resources on the
PePcon 2015 site!
Conference Site
Register Now
Speakers
Schedule Get in
Sponsors Touch
PDF Brochure
info [at]
indesignsecrets.com

Twitter:
@InDesignSecrets

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php[26-Oct-15 8:33:15 AM]


How to Install a Script in InDesign That You Found in a Forum or Blog Post | InDesignSecrets


Facebook:
InDesignSecrets

Follow Us!

Put InDesignSecrets in your InBox: Your email address for newsletter... * Go

2006 - 2015 INDESIGNSECRETS.COM ALL RIGHTS RESERVED

https://indesignsecrets.com/how-to-install-a-script-in-indesign-that-you-found-in-a-forum-or-blog-post.php[26-Oct-15 8:33:15 AM]

You might also like