Setting CMYK color value of picture box

Discuss AppleScripting for QuarkXPress 10, 9 & 8 (and before)
Post Reply
rgbherman
Posts: 0
Joined: 15 Jan 2007, 14:37

Setting CMYK color value of picture box

Post by rgbherman » 29 Mar 2013, 08:23

tell application "QuarkXPress"
activate

tell page 1 of layout space 1 of project 1
set RedTopBox to make picture box at end with properties {bounds:{"0 in", "0 in", "1.97 in", "12.9 in"}, color:"Red", runaround:none runaround}
end tell
end tell


Above is simple script to make a box. Box needs to have color. Text and image will go on top. How do I set the color type to CMYK and the color value of red? To kick off discussion, this doesn't work:

set CMYK color value of "Red" to "{c27, m98, y72, k21}"

Scripting_Ace
Posts: 684
Joined: 29 Jun 2004, 13:14

Setting CMYK color value of picture box

Post by Scripting_Ace » 29 Mar 2013, 12:36

try this:

001tell application "QuarkXPress 8"
002tell its project 1
003set newColor to make new color spec at end with properties {name:"newColor", CMYK color value:{17695, 64224, 47185, 13763}, separation:true}

004tell page 1 of layout space 1
005set RedTopBox to make picture box at end with properties {bounds:{"0 in", "0 in", "1.97 in", "12.9 in"}, color:"newColor", runaround:none runaround}
006end tell
007end tell
008end tell
Notes: The line numbers included with this script are there to aid future discussions. In order to use this script, you will have to strip all of them.

Jean-Marie Schwartz
Posts: 1174
Joined: 23 Nov 2004, 04:30

Setting CMYK color value of picture box

Post by Jean-Marie Schwartz » 30 Mar 2013, 01:44

rgbherman wrote:set CMYK color value of "Red" to "{c27, m98, y72, k21}"
It's not the way color values are defined in Quark. Check Quark'AS dictionary or AS forum searching for "color value"

rgbherman
Posts: 0
Joined: 15 Jan 2007, 14:37

Setting CMYK color value of picture box

Post by rgbherman » 01 Apr 2013, 04:08

Jean-Marie Schwartz: After looking at the forum post on color values I now understand how to convert them.
Scripting Ace: When I try to run your code, I get this messageSyntax Error: Expected end of line but found number. The 1 in Line 002 is highlighted.

Scripting_Ace
Posts: 684
Joined: 29 Jun 2004, 13:14

Setting CMYK color value of picture box

Post by Scripting_Ace » 01 Apr 2013, 04:41

Try removing the "its" part... This may be Script Debugger related.

rgbherman
Posts: 0
Joined: 15 Jan 2007, 14:37

Setting CMYK color value of picture box

Post by rgbherman » 01 Apr 2013, 05:06

Same error

Scripting_Ace
Posts: 684
Joined: 29 Jun 2004, 13:14

Setting CMYK color value of picture box

Post by Scripting_Ace » 01 Apr 2013, 06:48

rgbherman wrote:
Same error

This makes no sense!
[ulist][*]Did you remove the line numbers as stated?[*]Did you remove the " 8" from the application name? (I renamed my Quark installations to be able to script all versions independantly)[*]Other than that, the only thing I can think of is that a funky character got copy/pasted between this board and your script.[/ulist]HTH

rgbherman
Posts: 0
Joined: 15 Jan 2007, 14:37

Setting CMYK color value of picture box

Post by rgbherman » 01 Apr 2013, 07:30

I had not removed 8 from the application. Works brilliantly! Many thanks!

Post Reply

Return to “QuarkXPress 8, 9 & 10: AppleScript”