Skip to main content
Jongware
Community Expert
Community Expert
June 22, 2007
Question

ANN: Indesign CS3 JS help to HTML using XSLT

  • June 22, 2007
  • 13 replies
  • 1873 views
I felt quite at home with the previous CS's JS Help PDFs, but I'm not too wild about the ExtendScript editor. But if you don't use that, you miss out the online help! Fortunately, in one of the ExtendScript subfolders you can find an XML document with the slightly bizarre name "omv$indesign-5.0-en_us.xml". This contains the entire help document, in handy XML format.

As an exercise, I wrote an extensive XSL stylesheet to convert it to fully cross-referenced HTML. This script is a bit too long to include here, but you can d/l it at http://www.jongware.com/binaries/indesign.xsl.

Run it through your favourite XSL processor, and you get the whole thing in one huge file. Alternatively, you can select either a single class or enumeration (such as "TextFrame") or a single alphabetic letter ("A", just to provide an example, will process all classes and enums from "AlignDistributePreference" to "AutoEnum"). In these cases, the hyperlinks will (obviously/unfortunately) fail.

It is quite possible to load the 113,000 line XML into InDesign and apply formatting to it, but I think I'll leave it at this.
This topic has been closed for replies.

13 replies

Known Participant
February 19, 2008
thanks thats a very fair explanation

hopefully, we all will get a new update (via Adobe Updater) of the scripting model soon (thumbs up Olav) with ALL the items FULLY HYPERLINKED by default, so somebody like you guys can generate new HTML with all the entries FULLY HYPERLINKED...

indesigncs3jshelp.zip is BY NOW THE BEST MODEL DICTIONARY, or is it ?

isnt there any proprietary of 3rd party viewer to load the scripting model and give us some more features ? like FIND with results, or other...
Jongware
Community Expert
JongwareCommunity ExpertAuthor
Community Expert
February 19, 2008
Thanks, Rosta!

I had a lot of fun hyperlinking the obvious items, but unfortunately, as Olav Kvern (responsible for the scripting model) explains somewhere else in this thread, some items are described as "free text" only. It's theoretically possible to weed the links out using XSLT, but the wording is quite different from case to case. And I'd rather not edit the original XML file by hand, as it is auto-generated by ID when needed, so new plugins can be added.

Olav is aware of this and has been press-ganged to change it in future versions :-)

For the moment I'm content with the HTML as it is -- I use it myself per default --, so don't expect any major changes.
Known Participant
February 19, 2008
hallo jongware

one good fellow pointed me from this thread of mine:

http://www.adobeforums.com/webx/.3bbf275d.3c062852/2

to your excellent object model HTML particullary this version:
http://www.jongware.com/binaries/indesigncs3jshelp.zip

my XML and HTML skills are zero so i really appreciate somebody did the job of creating hyperlinked HTML WHICH I LOVE

i only have few sugesstions to make this object model dictionary THE STANDARD REFERENCE for CS3 :)))

iam i right that if i click through:

Basic Suite / Application /

i see this exemplary entry:

activeWindow | any | r/w | The front-most window. Can return: Window, LayoutWindow or StoryWindow.

would it be possible to make "Window" "LayoutWindow" "StoryWindow" in the description text clickable hyperlinks to respective entries...

this level of hyperlink structure is missing and that would make this a INDISPENSABLE JAVASCRIPT REFERENCE GUIDE !!!
Jongware
Community Expert
JongwareCommunity ExpertAuthor
Community Expert
September 18, 2007
Thanks guys, for the praise on my hard work :-)

Note that all information in the HTML can also be found in the ExtendScript editor (in fact, it's the other way around, and the ESTK is "hot" -- it adds new objects for plugins dynamically).

Still, the XSLT can be used for a variety of special purposes. For example, Dave, with a little deft re-writing, can output all or a selection of enumerations in handy HTML format.

Ole noted he didn't have the inclination to create a fully cross-referenced PDF for CS3. That might be a project for someone with some time on his/her hands. It sounds easy; re-write the style sheet to output InDesign interchange format, rather than HTML, and load in ID. Done. (At least the basic principle sounds easy!)

If this thread would be made "sticky", does that mean I have to provide the zip file for some undefinite time on my site? It is rather a hefty download; my provider does not provide any download details *at all*, so I don't even know how popular it is.
Known Participant
September 17, 2007
Thanks to Jongware for making this available. I never knew if I was missing the Javascript reference PDF for CS3 or if it was never made.

Good to find out that this ZIP archive has the necessary information for this. I appreciate it, thanks for the great work.

Moderators, please consider making this a permanent post!
Inspiring
September 13, 2007
Hi Jongware,

I stumbled upon this excellent piece of work this afternoon while trying to find my own expansion of the InDesign CS3 enumerations. Very nice indeed! Thank you very much.

Dave
Known Participant
June 28, 2007
Hi Harbs, [Jongware],

The dynamic model also means that if third party plug-ins implement scripting the way we (politely) ask them to, the object, properties, and methods they expose will appear in the model as first-class (so to speak) citizens. This also means that data they add to the model will be preserved in INX and snippets (both of which are built on scripting).

It's so cool.

Thanks,

Ole
Harbs.
Legend
July 1, 2007
Olav_Kvern@adobeforums.com wrote:
> This also means that data they add to the model will be preserved in INX and snippets (both of which are built on scripting).
>
Very good to know!

Thanks.
Jongware
Community Expert
JongwareCommunity ExpertAuthor
Community Expert
June 26, 2007
Hi Ole (and other scripting fans)

>By the way, it's important to note that the object model is dynamic. Add or remove plug-ins, and the model will change (and a new XML file will get written).

That is great! So I just have to regenerate my stuff, should need arise. Pity I can't locate the xmls for Photoshop et al -- any pointers?

In the mean time, I decided the *huge* HTML was just a bit unwieldy, so I got xsl:result-document to work. Result? A lot of documents :)

The entire help suite can be found under separately). You WILL need an XSLT 2.0 compliant processor; I used Saxon 8 for this one.

Enjoy!

[Jongware]
Known Participant
June 24, 2007
Hi jongware,

re: "...that's your (Ole's) fault, because of that "any" notation..."

Not...totally. The object model is actually generated by InDesign's plug-ins as they register their scripting support during the application's start-up. "Any" is just what the ESTK's object model viewer happened to choose as its way of representing multiple possible data types. I only get to edit the stuff in the description field. I agree that "any" isn't the right thing to say, and we'll try to get it fixed.

Anyway, the good news is that we were able to make an editing pass through the descriptions this time around, so they've improved somewhat--and that's for all languages, not just JavaScript.

By the way, it's important to note that the object model is dynamic. Add or remove plug-ins, and the model will change (and a new XML file will get written).

Thanks,

Ole
Harbs.
Legend
June 27, 2007
Olav_Kvern@adobeforums.com wrote:
> By the way, it's important to note that the object model is dynamic. Add or remove plug-ins, and the model will change (and a new XML file will get written).
>
Yes. I've noticed that. Great stuff!

Harbs
Jongware
Community Expert
JongwareCommunity ExpertAuthor
Community Expert
June 24, 2007
I sure had fun 'tokenizing' the "Can accept: xx, yy or zz" remarks for the "any" value into separate entries :) Only for Properties, though, since with most of the Methods you changed the wording. Please, for the next version, a list of these possible elements in the XML!

Some new items added: a full index (only if you check it in the XSL--it's quite long); more importantly, per class a list of "Element of", "Returned by", and "Used in", all hyperlinked to the extreme -- now you can see at a glance how all elements link together! These lists are not entirely complete (that's your (Ole's) fault, because of that "any" notation).

[PS: there seem to be no explanation of function return values...]

I understand the idea of the SVG block diagrams, and if I feel the urge (and have an example of what it should look like) I might give that a try -- just for laffs. In the mean time I'm finally gonna upgrade my CS1/2 scripts, using my own HTML to guide me :)

For the XSLT impaired amongst us, d/l the complete HTML page at jongware.com: indesign.zip (3.5MB, zipped to 471Kb). Enjoy!