🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #16983

More manipulating color swatches in InDesign/AS

#16983
From: John Darnell
Date: Wed, 09 Jul 2003 21:55
38 lines
2108 bytes
Failte, Fellow Scripters:

The following code is in a script:

tell application "InDesign"

set CurDoc to active document
tell CurDoc
tell last page

set currentframe to make text frame with properties {geometric bounds:{TopCoord, LeftCoord, BottomCoord, RightCoord}, label:BoxNumber}

set mycolor to "C=0 M=100 Y=0 K=0"
set colorlist to name of every color of CurDoc
if mycolor is in colorlist then

-- The following dialog is displayed, so I must assume that mycolor is in colorlist, and thus names a valid swatch
display dialog "inside the mycolor if statement. Fill color is " & name of fill color of parent story of currentframe

set fill color of parent story of currentframe to swatch mycolor of CurDoc

--the program never displays the following dialog box, which must mean that the script fails on the above line.
display dialog "In the make text box handler. Fill color of parent story is " & name of fill color of parent story
end if

end tell

end tell
end tell

(* Please note that I cut a lot of code out that had nothing to do with this issue so if delimiters do not balance, that's probably why. This code, however, compiles, and without the swatch manipulation lines, runs without a hitch
* )

I've tried all sorts of variations in the code to make it work, and I cannot. Does anyone see where I might have gone wrong?

TIA.

John
Technical Details
Message-ID: <1de9daa6.-1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,eba378fead48f408,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-07-09 15:08:06 PST
From: "John Darnell" <John.Darnell@Walsworth.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-04!sn-xit-06!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: More manipulating color swatches in InDesign/AS
Message-ID: <1de9daa6.-1@WebX.la2eafNXanI>
Date: Wed, 9 Jul 2003 14:55:07 -0700
Lines: 48
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit