Article View: adobe.scripting.indesign
Article #15080JS: Drop Shadow x/y offset problem
From: Keith_Gilbert
Date: Tue, 16 Dec 2003 16:42
Date: Tue, 16 Dec 2003 16:42
24 lines
1803 bytes
1803 bytes
I'm hacking my way through my first JavaScript, and have run into one specific problem. I'm trying to script adding a shadow to the selected item. The script below works. The blend mode and blur radius get set properly, but the mySelection.shadowxOffset = 3 and mySelection.shadowyOffset = 3 lines have no effect. No matter what values I assign to shadowxOffset and shadowyOffset, I get exactly the same shadow offset. What is going on here? Running ID CS, Windows XP.
//First, check to see whether any InDesign documents are open.
//If no documents are open, display an error message.
if (app.documents.length > 0){
if (app.selection.length > 0) {
//Something is selected.
var mySelection = app.selection[0];
mySelection.shadowMode = 2020623440
mySelection.shadowBlendMode = 2020625762
mySelection.shadowOpacity = 20
mySelection.shadowxOffset = 3
mySelection.shadowyOffset = 3
mySelection.shadowBlurRadius = 10
}
else {
//Nothing is selected, so display an error message.
alert("Nothing is selected. Please select an object and try again.")
}
}
else {
//No documents are open, so display an error message.
alert("No InDesign documents are open. Please open a document and try again.")
}
Technical Details
Message-ID:
<2ccef3af.-1@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!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,fda6f4796a1c75cb,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-12-16 09:07:55 PST From: Keith_Gilbert@adobeforums.com Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: JS: Drop Shadow x/y offset problem Message-ID: <2ccef3af.-1@webx.la2eafNXanI> Date: Tue, 16 Dec 2003 08:42:41 -0800 Lines: 31 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit