Copy link to clipboard
Copied
As a novice to Illustrator and Illustrator scripting. I notice that without good knowledge of Illustrator (the GUI and/or scripting), it's a bit tricky to correlate the type of item/object an item is as seen in the Illustrator GUI selecting the item on screen and/or seeing it in the layer's window. Because both of those don't indicate the matching Illustrator scripting item/object type, and I have to guess at what it is (or iteratively/recursively dump all items and see if I can figure out what is what from the dumped items from the script comparing to the info/properties in the UI).
Or is there some mapping feature that will indicate this that I overlooked? If not, how best to correlate?
As some examples:
* how to figure out what type of object text is that we see in the Illustrator document (assume total novice, not knowing specific text types in Illustrator)
* how to figure out whether a certain item in a layer is a page item, path item, or both? I can't tell.
Copy link to clipboard
Copied
You really need to explore this
Copy link to clipboard
Copied
Larry G. Schneider wrote:
You really need to explore this
Thanks for the tip, I'll check that out. On a brief look, it's not much different from the scripting reference other than having a bit more details here and there in terms of general/generic (javascript) objects.
I guess what I'm kind of aiming for may be closer to this: http://wundes.com/JS4AI/explore.js, except I prefer not to do the trial & error of select this & see what it is, then select that & see what it is.
Would be kind of nice to have something like a visual reference (screenshots, Youtube video) that shows when you see these items on screen in the active document in Illustrator GUI, then it is refering to those Illustrator scripting objects, etc. But I'm assuming neither Adobe nor some 3rd party has done such a visual mapping/reference, so my best bet is that explore.js?
Also, as an analogy, for HTML DOM of a web page, what you see visually corresponds to different DOM element tags in HTML source. If you search online enough, there are tutorials that also include a visual reference of what this DOM element tag represents visually on a page. I'm looking for the equivalent for Adobe Illustrator, e.g. this object item in scripting may look like this on the screen of a document.
Copy link to clipboard
Copied
Since you have found out there's no visual guide to match GUI items with javascript objects, why don't you create one? I think you have a great opportunity to create a reference to be used by generations to come.
Copy link to clipboard
Copied
I assume this is a continuation from your previous thread?
https://forums.adobe.com/thread/1765707
The only thing I have ever seen (regarding a visual reference of any kind from Adobe) is this regarding the Application SDK:
http://cssdk.s3-website-us-east-1.amazonaws.com/sdk/2.1/docs/WebHelp/app_notes/AI_obj_model.htm

[^ Pretty impressive (insert sad/pathetic) coming from the market leader in graphics software huh?]
Anyway, it looks like you are at a crossroads of needs and wants and may have to fulfill each of these yourself due to their lack of current existence. 😉
Copy link to clipboard
Copied
Thanks for the diagram, looks like I'll have to learn & do things the harder way.
Copy link to clipboard
Copied
In regards to a similar relation to HTML/DOM - Design vs Code View, maybe you could do something along the lines of the following:
- ScriptUI
- Bridgetalk
- Populated scrolling treeview of all items in document and relative/desired dumped data about each
- StaticText / EditText holds dumped data of selected item
- Selection in ScriptUI treeview selects item in IDE for cross referencing
- etc
Kind of like a underlying code view for Illustrator on an object by object level.
--------------
Do you have a limited amount of returned data you want (as seen in your other thread (position, width, height, etc...))?
So..... what is your ultimate hope or even need for this?
Copy link to clipboard
Copied
That would be quite a project for a pseudo-IDE within Adobe app build on ExtendScript (or the SDK). That sure would be nice though, but probably something a long time coming, I'm probably not up for building such a thing myself.
The point of the post though was a way to more effectively understand relations of items in the visual document mapped to the corresponding scriptable objects. It's not so easy as I currently see it when items aren't "named" within layers, and when you get compound paths, grouped items, etc. and you are only a novice Illustrator users not familiar with all those concepts of the different scriptable object items and what they actually are/do in the visual document.
The post was a generic question, not specific to the work I would be doing in the organization besides being familiar with Illustrator scripting.
Copy link to clipboard
Copied
this document is a good resource.
see page 118 on pageItems.
this will get you started.
var p = app.activeDocument.pageItems
for(var i = 0; i < p.length; i++){
alert(p.typename);
}
Copy link to clipboard
Copied
imagecollection wrote:
this document is a good resource.
see page 118 on pageItems.
this will get you started.
var p = app.activeDocument.pageItems for(var i = 0; i < p.length; i++){ alert(p.typename); }
Um, typename just returns the collection type's name correct? So if you already knew what collection you were iterating through, then typename isn't much benefit. Only when you are iterating through a reference to a collection whose type you don't know does that come in handy.
But thanks for the comment. I've seen the mentioned resource already, although I used the CS6 and CS5 versions myself.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more