Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 93817

Re: Indesign Applescript Placed Object Layer Visibilty Override

$
0
0

Wow, that was so easy!  Thanks for the tip.

 

Took about 30 seconds for a 36 page document with 3 layers to check per link.

 

Had planned to use a list when everything was working.  Here's the final:

 

tell application "Adobe InDesign CC 2014"

   

    # With which document are we working?

    set theDocName to "My Indesign Document.indd"

   

    # Create a list of layer names to check

    set theLayersList to {"My Layer 1", "My Layer 2", "My Layer 3"}

 

    # Which layer do we want to be visible?   

    set theDesiredLayer to item 2 of theLayersList

   

     ######################

     # No need to edit below... #

     ######################

 

    # Create an object of all document links in the chosen document

    set theDocLinks to links of document named theDocName

   

    # Cycle through the links

    repeat with i in theDocLinks

       

        # Create an object of all the graphic layer names of the current link

        set theGraphicLayers to name of graphic layers of graphic layer options of parent of i

       

        # Cycle through the layers

        repeat with j from 1 to count theGraphicLayers

           

            # Set the current layer name

            set theCurLayer to item j of theGraphicLayers

           

            # Is this a layer to check?

            if theCurLayer is in theLayersList then

               

                # Is it the layer I wish to be visible?

                if theCurLayer is theDesiredLayer then

                    # YES - Set visibility to true

                    set current visibility of graphic layer j of graphic layer options of parent of i to true

                else

                    # NO - set visibility to false

                    set current visibility of graphic layer j of graphic layer options of parent of i to false

                end if

               

            end if

           

        end repeat

       

    end repeat

   

end tell


Viewing all articles
Browse latest Browse all 93817

Trending Articles