Most recent update (All By Hand(TM)): 18-Jan-2015 19:54

 

 

... I'm tired of using technology
I need you right in front of me ...

Milow, Ayo technology (originally by 50 Cent)

 

 

InDesign JavaScript Reference Guide

Scripting is one of the most powerful features in InDesign. It can save lots of time: almost anything you can do with the user interface, you can do faster with scripts, and there are even a few things you can do in scripting that you cannot do from within the user interface. So, with every new version, I downloaded the latest Scripting Reference Guide from Adobe and went a-browsing for new features and possibilities. Unfortunately, starting with InDesign CS3, Adobe chose not to include the JavaScript reference as a PDF, but have users access it through their ExtendScript editor instead. They probably assumed everyone would use that to write and edit scripts. Well, they were wrong. I'm so much more used to plain text editors (my current favourite has been TextPada for a while), which have oodles more handy functions than the ExtendScript one. But if you use another editor, you'll miss out on the help!

 

No sweat. Amongst the literally hundreds of files of InDesign, I found a large one with the rather weird name "omv$indesign-5.0-en_us.xml". Curious as ever, I opened it, and – joy! – it appeared to contain each and every scriptable object, class, name, function and enumeration for JavaScript. Even better, it also had a description of every item – exactly the one in the ESTK help! I happen to be quite handy with XSLT, the Extensible Stylesheet Language Transformation language, which is specifically designed to transform one XML document to another. Since HTML is a kind of XML (to be precise, its nicely formatted sibling XHTML is), it's entirely possible to take the large, unwieldy and unreadable XML file, and have it converted into one or more perfectly formatted and nicely readable HTML files.

 

So far so good: it's rather easy to re-format this help file into HTML, exactly as it is in the ExtendScript editor. But I could do even better! By carefully reading the text and examining properties of objects, I could create cross-reference hyperlinks to just about everything in the descriptions, and to visually display parent-child relations between objects – a tremendous help in understanding the object model.

 

ID CS3 Help

 

Adobe used almost the same XML format for CS4, and to my surprise, it was no trouble at all to include the new items into the existing XSLT. Its current output is HTML, but as fellow scripter ABC GREEN pointed out, Microsoft offers a free tool to convert a set of HTML files into a fully indexed and searchable CHM file. ABC GREEN kindly compiled the CS3 version (a couple of times, even), and helped me set up things for CS4.

Adobe also used almost the same XML format for CS5, and again, it was no trouble at all to include the new items into the existing XSLT – this time, on my Mac. However, you still need a Windows machine to compile the HTML... and my (t)rusty old Windows machine had a hard disk crash. Fortunately, my friend René Kramer (1967-2010) could salvage most, if not all, data from that system. My thanks for being a good friend, despite this!

 

The results of all of this work can be downloaded freely from the following links. All of the files are packed as ZIP files; download, save it somewhere, then unpack. Your operating system should be able to do so automatically – if not, search the web for a PkZip compatible unpacker.

Note that the Windows Help file format CHM is not usable on Macintosh OS X without additional software (not provided -- but see below).

 

The HTML help files can be browsed on-line, thanks to John Hawkinson of MIT, at http://jongware.mit.edu/

 

a Tip for TextPad users: you can easily add the CHM version as an external Help Set! See the manual for the exact how-to of your version.

 

InDesign CS

InDesign CS JavaScript Help, Windows CHM format (3.0.3d, updated: 27-Jun-2010)

InDesign CS2

InDesign CS2 JavaScript Help, Windows CHM format (3.0.3d, updated: 27-Jun-2010)

InDesign CS3

InDesign CS3 JavaScript Help, separate HTML files

InDesign CS3 JavaScript Help, Windows CHM format (3.0.3d, updated: 27-Jun-2010)

Browse online

InDesign CS4

InDesign CS4 JavaScript Help + JavaScript Core Classes + ScriptUI, separate HTML files (3.0.3i, 29-Apr-2012)

InDesign CS4 JavaScript Help + JavaScript Core Classes + ScriptUI, Windows CHM format (3.0.3i, 29-Apr-2012)

Browse online

InDesign CS5

InDesign CS5 JavaScript Help + JavaScript Core Classes + ScriptUI, separate HTML files (3.0.3i, 29-Apr-2012)

InDesign CS5 JavaScript Help + JavaScript Core Classes + ScriptUI, Windows CHM format (3.0.3i, 29-Apr-2012)

Browse online

InDesign CS5 Server

InDesign CS5 Server JavaScript Help, separate HTML files (3.0.3d, 24-Mar-2011)

InDesign CS5 Server JavaScript Help, Windows CHM format (3.0.3d, 24-Mar-2011)

InCopy CS5

InCopy CS5 JavaScript Help, separate HTML files (3.0.3d, 24-Mar-2011)

InCopy CS5 JavaScript Help, Windows CHM format (3.0.3d, 24-Mar-2011)

InDesign CS5.5

InDesign CS5.5 JavaScript Help + JavaScript Core Classes + ScriptUI, separate HTML files (3.0.3i, created: 28-Apr-2012)

InDesign CS5.5 JavaScript Help + JavaScript Core Classes + ScriptUI, Windows CHM format (3.0.3i, created: 28-Apr-2012)

Browse online

InDesign CS5.5 Server

InDesign CS5.5 Server JavaScript Help + JavaScript Core Classes, separate HTML files (3.0.3i, 28-Apr-2012)

InDesign CS5.5 Server JavaScript Help + JavaScript Core Classes, Windows CHM format (3.0.3i, 28-Apr-2012)

InCopy CS5.5

InCopy CS5.5 JavaScript Help, separate HTML files (3.0.3i, 28-Apr-2012)

InCopy CS5.5 JavaScript Help, Windows CHM format (3.0.3i, 28-Apr-2012)

InDesign CS6

InDesign CS6 JavaScript Help + JavaScript Core Classes + ScriptUI, separate HTML files (3.0.3i, created: 28-Apr-2012)

InDesign CS6 JavaScript Help + JavaScript Core Classes + ScriptUI, Windows CHM format (3.0.3i, created: 28-Apr-2012)

Browse online

InDesign CS6 Server

InDesign CS6 Server JavaScript Help + JavaScript Core Classes, separate HTML files (3.0.3i, 28-Apr-2012)

InDesign CS6 Server JavaScript Help + JavaScript Core Classes, Windows CHM format (3.0.3i, 28-Apr-2012)

InCopy CS6

InCopy CS6 JavaScript Help, separate HTML files (3.0.3i, 28-Apr-2012)

InCopy CS6 JavaScript Help, Windows CHM format (3.0.3i, 28-Apr-2012)

JavaScript Core Classes

JavaScript Core Classes, separate HTML files

JavaScript Core Classes, Windows CHM format

Browse online

This and the ScriptUI classes are integrated into the CS4 and CS5 help, but as it was a lot of extra manual labour, I'm not going to do that for CS3.

ScriptUI

ScriptUI, separate HTML files

ScriptUI, Windows CHM format

Browse online

Illustrator CS4

Illustrator CS4 Javascript Help, Windows CHM format (v3.0.3d)

Illustrator CS5

Illustrator CS5 Javascript Help, Windows CHM format (v3.0.3d)

Illustrator CS6

Illustrator CS6 JavaScript Help + JavaScript Core Classes, separate HTML files (3.0.3i, 25-Nov-2012)

Illustrator CS6 JavaScript Help + JavaScript Core Classes, Windows CHM format (3.0.3i, 25-Nov-2012)

Photoshop CS5

Photoshop CS5 JavaScript Help, separate HTML files (3.0.3i, 28-Aug-2012)

Photoshop CS5 JavaScript Help, Windows CHM format (3.0.3i, 28-Aug-2012)

FrameMaker 10

FrameMaker 10 JavaScript Help, separate HTML files (3.0.3f, created: 31-Oct-2011)

FrameMaker 10 JavaScript Help , Windows CHM format (3.0.3e, created: 31-Oct-2011)

New FrameMaker 12

FrameMaker 12 JavaScript Help, separate HTML files (1.0, created: 18-Jan-2015)

FrameMaker 12 JavaScript Help , Windows CHM format (1.0, created: 18-Jan-2015)

Browse online

Questions, anyone?

  • HTML, Windows... how about a Mac version? I can convert the data to SpotLight dictionary format and compile it into a real usable dictionary. However, that's not nearly as useful as I thought it would be! The Dictionary style is not particularly suitable for this kind of information. Instead, I recommend Mac users to download Robin Lu's iChm and use this to view the (Windows!) CHM version with. I've tried a handful of Mac CHM viewers, and this one stood out as the best, what with nearly faultless display of my file, custom bookmarks, and both indexed and full text searching. If I had a Thumbs Up icon, I'd display it!
  • How do I search in these files? The Windows Help version has a Search button, and, depending on your CHM viewer version, you can search in the index only, or in the full text as well. Robin Lu's iChm for the Mac allows both index and full text search (other viewers may not have both, or either, of these options). To search in the large set of HTML files, you will need a program that's able to search inside HTML. Plain text searching may have difficulties with the HTML formatting.
  • There are no code samples. That's because there were no code samples in the original Help set. Start the ESTK and try to find them in there if you don't believe me. And I'm too lazy to insert samples for each and every class, property, and method (the mere thought of that ... there are thousands of 'em! And I haven't even used half of them myself!).
  • I can't find what I need. Start up ExtendScript and look in the Help there. If you cannot find it there either, read the Starting Scripting Tutorial. Perhaps it does not exist.
  • I'm writing a script but having trouble. How do I do X? As a general rule, I don't help people in private. Post your question in the InDesign Scripting Forum.
  • I sent you a question, using the "Private Message" function on the forum but you never answered me back. Why? As a general rule, I don't help people in private. Post your question in the InDesign Scripting Forum.
  • I don't use InDesign but program Y. Can you help? No. Read the above text–all of it. It only mentions InDesign.
  • I don't use JavaScript but scripting language Z. Can you help? Same answer as above.
  • Can I freely put these files on my website? As far as I'm concerned, sure. Don't pretend you created them, though, by modifying the files, or by just not mentioning where you got'em. It was a lot of work. Also, I will not notify you if I create a new version.
  • Okay, this is not about js or indesign but clearly you are a very clever guy so don't say 'no' in advance. Are you interested in I already stopped reading. Whatever it is, my answer is highly likely to contain "no" somewhere.
  • gr8 site!!! im hvin trbls w/my scirpt can u hlp pls!!! What?
  • [Hypothetical] CC has been out for 1 week 2 months five years now and there is still no new help set! Perhaps the help format has changed. Or maybe I changed my mind on "free" stuff and now you can only rent it, with a monthly fee.

 

 


Say No to the Creative Cloud!
[Jongware]

Many thanks to ABC GREEN for help with the CHM version, to Dave Saunders, Harbs, and Loic Aigon for assistance unmentioned, and to John Hawkinson for mirroring the files.

These files are derivatives from original data by Adobe Systems Incorporated. Errors may have crept into the translation, and in that case are most likely exclusively mine. The original version of the files as supplied with the original programs by Adobe are authoritative.

InDesign CS3, InDesign CS4, InDesign CS5, InDesign CS5.5, InDesign CS6, PhotoShop, Illustrator, FrameMaker, ExtendScript and ScriptUI are trademarks of Adobe Systems Incorporated.