2 Replies Latest reply on May 4, 2009 1:44 PM by wreyfmonkey

    Applescript: Delete Object with Properties...

    wreyfmonkey Level 1

      Hi All,


      I have gotten myself into a bit of trouble by altering an unbelievably massive amount of InDesign files (11,000+) with an Applescript that was perfect, save for one minor detail: it ungrouped an object on each file that was supposed to remain a group.  As a group, the object had a script labeled name so that it was easy to talk to:


      tell application "Adobe Indesign CS3" to delete page item "Logo1" of document 1


      But now that the grouped objects that once formed "Logo1" have been ungrouped, I am trying desperately to figure out a way to talk to those individual pieces so that I can either 1) delete them and paste on a new "Logo1" from a library or 2) re-group the pieces and re-script label the group.  One way I have been trying is to find a property of each piece that is unique to that piece...like it's geometric bounds or its vertical or horizontal scale and gather the pieces that way and group them.


      At any rate, here is my dillemma...I think I can figure out all the solutions I mentioned above if I could just simply find a way to talk to an object with properties "xyz".  For the life of me, I can't get a script to compile!  Here is one of my attempts:


      tell application "Adobe InDesign CS3"

      set theObject to object with properties {geometric bounds:{0.205992407304, 0.432707105106, 0.224614903901, 0.491034738695}}

      end tell


      I feel kinda lame getting hung on something that seems so simple, but what IS my object?  I've tried talking to "object", "polygon", "rectangle", etc.  How in the world can I talk to an object that doesn't have a "name" but does have certain properties that I know?


      Any help will be greatly appreciated!  ...like really, really greatly appreciated. Thanks!