pythonadobe-indesignpy-appscript

InDesign script labels in appscript python module


I'm using appscript to create an InDesign document from Database data, but I can't seem to figure out how to set the contents of the objects in my page. In older versions of ID (CS4 and earlier, if i'm correct) I could get the object with script label foo by calling spread.page_items['foo']. However, this does not seem to work anymore. spread.page_items.ID(<foo_id>).label.get() does show foo, so the script label is set correctly.

The Adobe documentation speaks of a label property, however I haven't yet figured out how to use that property to correctly select the right object.

If there is a way to obtain an object's ID easily, that might also do the trick.


Solution

  • I managed to solve this after finding this article about references in appscript. I had to use a filter, like so: spread.page_items[its.label == 'foo'].

    Also, as suggested by Youngware below, the script labels support is indeed replaced by layer names.