Is it possible to use the javascript document object model in eclipse?
Copy link to clipboard
Copied
Hi community,
does anybody know if it is possible to integrate the Adobe document object model (the basic core classes, the scripting ui classes, the classes for indesign, photoshop, acrobat, ...) into Eclipse? It would be the heaven on earth to have all the class dependencies, all the attributes and methods right at and within eclipse.
I know Java and JavaScript are two different worlds, but let me give u an example so that u can easier understand what I am talking about: When I integrate an external library into any project in eclipse then I also add the source and the JavaDoc. The result is that Eclipse now knows all classes, all methods, attributes and so on. For example when I create an object of any class of that external library eclipse already knows all it's possible attributes and methods.
I got around 85 Adobe JavaScript projects within Eclipse and this would be soooooo useful. I am dreaming of some kind of jsx(bin) file(s) from Adobe that can be imported into eclipse projects and thus eclipse knows all the Adobe classes...
Am I just dreaming or is that possible?
Regards,
Daniel
Copy link to clipboard
Copied
I'm pretty sure this can be done.
maybe http://forums.adobe.com/message/5054999#5054999 might put a little light on the topic (talks about perl there) but I gather the objects can be passed to whatever you want.
I seem to remember Bob Stuckey passing to Java (could be way off there) do a search on it or send him a PM.
Copy link to clipboard
Copied
I dont want to send objects to any other programming or scripting language. All I want is having the Adobe document object model within eclipse to know all classes, attributes, methods while programming inside eclipse.
I think... I THINK if I had a .jsx file containing the complete description of all classes and stuff I could just include it as external library... but such a file does not exist.
Nobody writing Adobe scripts within eclipse at a higher level?
Copy link to clipboard
Copied
might this help you? http://jongware.mit.edu/idcs5/about.html
Copy link to clipboard
Copied
An excellent idea, Vamitul! With the help of XSLT, Adobe's omv*.xml files -- the files that contain the ExtendScript Help text -- can be transformed into whatever format is handy.
A couple of notes:
1. I was going to tell where to look for the files but I found it's bloody impossible to locate the originals on my computer. "Search files" just doesn't see them, or they are hidden well, or they reside in some impossible-to-search folder or subsystem.
By the way #1, the usual filename is "omv$indesign-7.0$7.0.xml", where "OMV" = "Object Model View" (I think), "InDesign" is the name of the program, the first "7.0" is the target version (7.0 is InDesign CS5), and the second "7.0" is the source version (ID comes with dictionaries for older versions as well, typically you'd only need the one for your current version.)
By the way #2: from memory -- I don't think the above is true for all programs in the CS "suite".
2. I collected data for InDesign, InCopy, Photoshop, Illustrator and Framemaker, as well as for Extendscript's Core Classes and ScruiptUI. I can't remember if Acrobat has a Help file in the same format or not -- I've never seen it, nor searched for it.
3. You cannot simply copy-and-paste all of the XML data into a single large file. For one, the XML data format does not allow this -- you would have to create a new XML structure. For two, lots of classes share the same name over the different programs -- "Window", for example, is something else in InDesign than it is in ScriptUI. I manually concatenated the Core and ScriptUI classes with ID's, and that alone was troublesome enough because of all the duplicates. There are cross-references inside as well, and you have to resolve these.
4. Just to give you a hint on the amount of data: ID CS4's XML file is 135,436 lines long, contains 469 classes, 305 enumerations, and just short of 5,000 methods. It took me several tries to initially get the same information as is shown in the OMV Help viewer (but after that I could improve on it ).
5. Converting the OMV into something else is a great exercise in XSLT programming: you're going to need all the tricks you can find. Not in the least because there are a number of minor coding errors in it -- dead links, typos, strangely converted UTF-8 characters ... the lot.
Copy link to clipboard
Copied
I found out that you can include "user libraries" for the complete development environment or for particular projects in Eclipse. These "user libraries" are just *.jsx files that contain the class descriptions including all attributes and methods. Though I don't know if these original .jsx files do exist anywhere (from Adobe?).
So basically: If there were .jsx files for all the different parts such as Photoshop, Indesign, Core, ScriptUI, ... then everyone could use Eclipse including contextual auto-complete. For me (as I am not a professional programmer, but working everyday with Adobe Scripts) this would be heaven. Having all the classes, methods, attributes within milliseconds instead of searching the API or the ESTK object model viewer for the particular method I am loking for.
Copy link to clipboard
Copied
d.stoeck wrote:
I found out that you can include "user libraries" for the complete development environment or for particular projects in Eclipse. These "user libraries" are just *.jsx files that contain the class descriptions including all attributes and methods. Though I don't know if these original .jsx files do exist anywhere (from Adobe?).
No, Adobe only supplies the raw XML data files. If you need another format, you have to transform them yourself -- as I did, from XML to HTML. I guess the Eclipse data files are JSON -- not a "difficult" format to create, but I am unfamiliar with the expected format and don't have the time to find out.
I do all my programming in TextPad (Windows) and TextWrangler (Mac), and don't mind the occasional switch to a CHM viewer to look up something in detail.
By the way: after an exhausting in-depth search, my computer finally found "C:\Program Files (x86)\Common Files\Adobe\Scripting Dictionaries CS4". That contains the data for Bridge, Illustrator, Photoshop, and "Common files" (ScriptUI and ESTK classes), but not for InDesign
Copy link to clipboard
Copied
Run ExtendScript fom Eclipse:
String[] commands = new String[]{"cmd", "/c", "start \"\" photoshop c:\\Users\\MyUserName\\Desktop\\new.jsx"}; try { Runtime.getRuntime().exec(commands); } catch (IOException e) { e.printStackTrace(); }
Copy link to clipboard
Copied
i can mostly live without autocomplete (sometimes it actualy annoys me), yet i would still love to use a better tool than ESTK. Even better, i would love the chance to hook up Visual Studio, and use TypeScript (http://www.typescriptlang.org) for scripting InDesign, but that means finding a way to use a different debugger than ESTK, and i don't think that is possible (please someone tell me i'm wrong)
Copy link to clipboard
Copied
If I understood correctly, so you want write ExtendScript in Eclipse instead of ExtendScrript toolkit and you want to get contextual autocomplete function (help system).
Bad news - AFAIK I didn't find anything which can replace ExtendScript toolkit.
ExtensScript Toolkit is really crap for middle-size and big-size projects at least because I autocomplete function does not work acros files attached with #include function.
For big-size projects is better main program write in any other multiplatform language (Ruby/Python…) and from that languages launch small ExtedScript scripts which comunicate with Adobe apps.

