3 Replies Latest reply on Apr 26, 2012 4:39 AM by matt.white

    Applescript to delete from selected layer and page

    matt.white Level 1

      Hi,

       

      This is part of a bigger script, but this is where I am having the problem. Hopefully very easy to solve, but driving me mad.

      I want to delete a text box from the active page only, and only from one layer.

      I can get it to work on one layer, but all pages. And on one page, but all layers.

       

      Could someone please help me write the line to select both active page and layer "slug".

       

      Thanks,

      Matt

       

       

      tell application "Adobe InDesign CS5"

      activate

                set myDocument to active document

                set myActivePage to the active page of the active window

                set myLayer to layer "Slug" of myDocument

                tell myLayer

          tell myActivePage

             ungroup groups

             delete (every text frame whose contents contains "delete me")

          end tell

                end tell

      end tell