• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

ANN: Indesign CS3 JS help to HTML using XSLT

Community Expert ,
Jun 22, 2007 Jun 22, 2007

Copy link to clipboard

Copied

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.
TOPICS
Scripting

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 22, 2007 Jun 22, 2007

Copy link to clipboard

Copied

Hi jongware,

Great stuff! I have an XSL template of my own that I used for testing conversion to HTML, and one that converts to InDesign tagged text (which I used to create the PDFs we used to publish), but it's great to have more ways of looking at the model.

Thanks for sharing this with the community!

Ole

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 23, 2007 Jun 23, 2007

Copy link to clipboard

Copied

Hi Ole!

Well I could have known... You *really* should have added hyperlinks to the PDFs!

I noticed I forgot to add "Array of" to some values--fixed it now. Oh, and if the string version of a constant displays a hyphen (-), don't use it--use the number instead 🙂 My display is kind of a programmer's trick.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 23, 2007 Jun 23, 2007

Copy link to clipboard

Copied

Hi jongware,

I agree, I *should* have added hyperlinks (apart from the bookmarks, which I did add).

But...when you multiply 5 (largish) object models (InDesign, InDesign J, InCopy, InCopy J, and InDesign Server) by three programming languages (AppleScript, JavaScript, VBScript) by three human languages (English, French, and Japanese), just getting the PDFs made at all becomes a pretty big deal.

It took literally years of political struggle to get the object model viewer into the ESTK--but once it was there, I didn't need to create the PDFs anymore. Which, I think, led to an improved Scripting Guide, sample scripts, and other good things. Part of the idea of making the viewer read an XML file was that people could make their own version of the viewer. Which you've done!:-)

One thing I have in not-ready-for-prime-time form is an XSL template that converts the XML into an SVG block diagram of whatever part of the model you're interested in. I would really like to get the time to finish that. But I have a fairly long list of other things I want to do!

Thanks,

Ole

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 24, 2007 Jun 24, 2007

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 24, 2007 Jun 24, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 27, 2007 Jun 27, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 26, 2007 Jun 26, 2007

Copy link to clipboard

Copied

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]

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 27, 2007 Jun 27, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 01, 2007 Jul 01, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 13, 2007 Sep 13, 2007

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 17, 2007 Sep 17, 2007

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 18, 2007 Sep 18, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 19, 2008 Feb 19, 2008

Copy link to clipboard

Copied

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 !!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 19, 2008 Feb 19, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 19, 2008 Feb 19, 2008

Copy link to clipboard

Copied

LATEST
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...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines