1 person found this helpful
I don't believe there is a property that indicates the origin of a page item, no.
But if you plan ahead and place a script label on your assets in the library, then you can check for that script label later.
Interesting, I'm not quite sure what scripting labels are. From what I've researched they are just a property that can be set to any string. Now would each of the assets get this set when they are created or when they are placed on the page? Or could it be either (I don't really know how/if I can run a script in the background that checks to see if an asset is placed on the page). Furthermore...You said I could check back and find that script label after...Would the page items each be "grouped" with the common property of the script label that matches the assets script label?
Sorry for so many questions, any answers would be awesome.
1 person found this helpful
They are arbitrary key/value pairs.
You would set them on assets when they are created and they are preserved
when the assets are insalled into the library, and still preserved
when the assets are placed into anew document.
I'm not sure why you use quotation-marks on the word "grouped."
The page items are not grouped, but you can check the script label
of every page item to see if it matches your previously-set label.
This worked great except when the same asset is placed twice on a page.
I still want to be able to distinguish between those two separately placed assets,
but when I find all page items with that script label it obviously gives me the collection
of both the placed assets. So now i'm trying to think of a clever way of determining
between two placements of the same asset.
I don't understand the problem. You get a collection back. Look at its length. The first one is the first one and the second one is the second one. What more do you need?
Sorry I didn't explain it very well. Take for example I have an asset with the name "test 1". That asset containts two page elements that each have the scripting label "test 1". Now when I place that asset on the page twice I have a total of 4 page items on the page all with the script label of "test 1" so when I search the page for matching script labels I get a collection of all four page items. My goal is to determine that two of them belong to the first asset that is placed and the next two belong to the second asset that is placed even if the same asset is placed twice.
Ah. That is difficult.
Can you group the items before placing them in the library? Then you can check to see what is a member of the same group.
hmm, I'm not sure. But I am exploring a different route using event
listeners but I can't seem to find a list of event types anywhere! Do you
know where I could find any documentation that would list all the available
I wish you luck, but I suspect that is not going to work. You can use http://jongware.mit.edu/idcs5/pc_Event.html as a reference for event types, but not all event types work on all objects, and I'm a bit skeptical you will be able to use the afterPlace event here. But maybe so! Definitely try it.