Article View: adobe.scripting.indesign
Article #18358Move object behind specific object
From: Michael Allison
Date: Wed, 02 Apr 2003 17:48
Date: Wed, 02 Apr 2003 17:48
49 lines
2622 bytes
2622 bytes
I have been using a drop shadow script that I found. It works great for a single object. However, if there are multiple objects on top of each other, sending the orginal item to front doesn't work. I would love to be able to send the drop shadowed box behind a specific object. Is there any way to do this. Below is the script. Thanks.
tell application "InDesign 2.0.2"
set currentdoc to active document
if selection as list is {} then
display dialog "You must select at least one object." buttons "Cancel"
end if
if class of selection is in {text, insertion point, graphic line} then
display dialog "The selection cannot be text or lines." buttons "Cancel"
end if
set mySelection to selection
repeat with i from 1 to count of mySelection
if class of item i of mySelection is in {oval, rectangle, polygon, text frame} then
set originalitem to item i of mySelection
set shadowitem to duplicate originalitem
if class of shadowitem is text frame then
set contents of shadowitem to ""
set content type of shadowitem to unassigned
end if
move shadowitem by {".03 in", ".03 in"}
--define these variables to set opaque versus transparent
set opaqueprops to {fill color:color "Black" of currentdoc, fill tint:30, stroke color:swatch "None" of currentdoc, label:"Drop Shadow"} as record
set tranparentprops to {fill color:color "Black" of currentdoc, fill tint:100, blend mode:multiply, opacity:30, stroke color:swatch "None" of currentdoc, label:"Drop Shadow"} as record
-- use variable from above in next line
set properties of shadowitem to opaqueprops
if fill color of originalitem is swatch "None" of currentdoc then
set fill color of originalitem to swatch "Paper" of currentdoc
end if
bring to front originalitem
end if
end repeat
end tell
Technical Details
Message-ID:
<1de8911a.-1@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!proxad.net!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!WebXShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f939a,c5c57c8bd3f8d4c1,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-04-02 10:08:07 PST From: "Michael Allison" <allisonm@executiveboard.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!proxad.net!newsfeed.tpinternet.pl!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Move object behind specific object Message-ID: <1de8911a.-1@WebX.la2eafNXanI> Date: Wed, 2 Apr 2003 09:48:55 -0800 Lines: 59 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit