0

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.

Mogsdad
  • 44,709
  • 21
  • 151
  • 275
Sander
  • 1,183
  • 12
  • 27

1 Answers1

0

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.

Sander
  • 1,183
  • 12
  • 27
  • 1
    For a discussion on your `label` troubles, read the Adobe Forums discussion [With CS5, some things have changed](http://forums.adobe.com/thread/615381); its handling labels differently is discussed and options are given (for ExtendScript, but it seems this ought to work for your scripting language as well). – Jongware Nov 11 '13 at 19:02
  • If the newer InDesign versions indeed support the use of layer names, that would be even better. Thanks for the link! – Sander Nov 14 '13 at 10:32