2 Replies Latest reply on Apr 1, 2009 11:53 AM by (rosie_cantrell)

    AS - Telling ID to find a specific layer

    (rosie_cantrell)
      Hi all,
      I trying to create a script that will be a part of a folder action
      where I've grabbed an existing script that I use to export PDFs and
      instead of the PDF making I'm trying to have it find an existing layer
      called "notes" in my document and then change it's layer color to
      magenta. Here's the part that seems to wrong...

      tell application "Adobe InDesign CS3"
      launch
      set myDocument to open file (source_file as string)
      tell myDocument
      set myLayerN to page item layer "notes"
      set myLayer to make myLayerN with properties {layer color:magenta}
      save myDocument to target_path
      close myDocument
      end tell
      end tell

      I'm getting an error saying invalid parameter. My guess is that I'm
      not finding the notes layer correctly. Can anyone offer any guidance?

      TIA,
      Rosie
        • 1. Re: AS - Telling ID to find a specific layer
          Level 1
          Hi Rosie,

          Replace:

          set myLayerN to page item layer "notes"
          
          set myLayer to make myLayerN with properties {layer color:magenta}


          With:

          set myLayerN to layer "notes"
          
          --no need to create a new layer
          set layer color of myLayerN to magenta

          Thanks,

          Ole
          • 2. Re: AS - Telling ID to find a specific layer
            (rosie_cantrell) Level 1
            Ole,<br />Perfect thank you!!<br /><br />I can see where I got myself mixed up.  This is what happens when I<br />try to use an existing script that I have for creating layers with<br />colors and modifying it change an existing layer. :) Thank you again!<br /><br />Thanks,<br />Rosie<br /><br /><br />On Wed, Apr 1, 2009 at 1:54 PM, Olav Kvern <member@adobeforums.com> wrote:<br />> A new message was posted by Olav Kvern in<br />><br />> InDesign Scripting --<br />>   AS - Telling ID to find a specific layer<br />><br />> Hi Rosie,<br />><br />> Replace:<br />><br />> set myLayerN to page item layer "notes"<br />> set myLayer to make myLayerN with properties {layer color:magenta}<br />><br />> With:<br />><br />> set myLayerN to layer "notes"<br />> --no need to create a new layer<br />> set layer color of myLayerN to magenta<br />><br />> Thanks,<br />><br />> Ole<br />><br />> ________________________________<br />> View/reply at AS - Telling ID to find a specific layer<br />> Replies by email are OK.<br />> Use the unsubscribe form to cancel your email subscription.<br />><br />>