Article View: adobe.scripting.indesign
Article #9139Re: Select Layer by Name?
From: low_jackson
Date: Mon, 11 Sep 2006 15:43
Date: Mon, 11 Sep 2006 15:43
46 lines
2075 bytes
2075 bytes
Hi
Here is my entire script, Its for adding a keyline to ad or document, I need to run the script and then continue working on the document by hand.
--
tell application "Adobe InDesign CS2"
activate
set myDocument to active document
set LayerName to "Keyline Box"
set myPageHeight to page height of document preferences of myDocument
set myPageWidth to page width of document preferences of myDocument
--make layer
tell myDocument
try
-- Does this layer exist ?
set myLayer to layer LayerName
on error
-- No? -> create it
set myLayer to make layer with properties {name:LayerName, layer color:red, visible:true}
end try
end tell
--make keyline box
tell myDocument
tell page 1
set MyKeylineFrame to make rectangle
tell MyKeylineFrame
set the geometric bounds to {"0", "0", myPageHeight, myPageWidth} -- Needs to fit to the page size
set the fill color to swatch "None" of myDocument
set the stroke color to swatch "Black" of myDocument
set the stroke tint to 100
set the stroke weight to 1
set the label to "MyKeylineFrame"
set item layer to myLayer
set the properties of myLayer to {locked:true}
-- *********************
-- Here is where I need to select "Layer 1 so I can continue working by hand, not script"
set LayerToActive to layer "Layer 1"
set active layer of active window to LayerToActive
-- *********************
end tell
end tell
end tell
end tell
end
--
Technical Details
Message-ID:
<3bc19367.7@webcrossing.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!news.isoc.lu!webcrossingReferences:
<3bc19367.-1@webcrossing.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,5adc33cad37aeca X-Google-Attributes: gidf939a,public X-Google-Language: ENGLISH,ASCII-7-bit From: low_jackson@adobeforums.com Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news.germany.com!news.isoc.lu!webcrossing Newsgroups: adobe.scripting.indesign Subject: Re: Select Layer by Name? Message-ID: <3bc19367.7@webcrossing.la2eafNXanI> Date: Mon, 11 Sep 2006 08:43:00 -0700 References: <3bc19367.-1@webcrossing.la2eafNXanI> Lines: 51 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit