This content has been marked as final. Show 15 replies
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!
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.
I agree, I *should* have added hyperlinks (apart from the bookmarks, which I did add).
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!
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!
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.
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).
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-documentto 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.
> 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!
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.
> 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!
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.
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!
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.
one good fellow pointed me from this thread of mine:
to your excellent object model HTML particullary this version:
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...
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.
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...