RE: Assigning Quark color spec - Tiger->Leopard
RE: Assigning Quark color spec - Tiger->Leopard
- Subject: RE: Assigning Quark color spec - Tiger->Leopard
- From: "Nielsen, Karen S. (Schmidt)" <email@hidden>
- Date: Thu, 8 Jan 2009 12:53:47 -0600
- Thread-topic: Assigning Quark color spec - Tiger->Leopard
Hi-
This is some code that I use to set color in Quark.
It works on Tiger or Leopard and with Quark 7 or 8.
I had to switch all my previous scripts to using the
properties settings to get them to work on Leopard. Fortunately the
properties setting works on Tiger too.
Hope this helps.
tell application "QuarkXPress"
tell document
1
set myCode to the properties of color of (story 1 of text
box (item y of mylabel))
set baseCodeColor to the name of
myCode
if baseCodeColor is equal to "Code FPO"
then
set color2 to
myCodeColor
set properties of (story 1 of text box
(item y of mylabel) of page myPage) to {color:(color spec color2)} --for
Leopard
if the name of color of (text box (item y of
mylabel) of page myPage) is equal to "White"
then
set properties of (text box (item y of
mylabel) of page myPage) to {color:(color spec "Black"), shade:0} --for
Leopard
else if the name of color of (text box (item
y of mylabel) of page myPage) is not equal to "None"
then
set properties of (text box (item y of
mylabel) of page myPage) to {color:(color spec color2)} --for
Leopard
end if
set
myCodeColor to color2
else if myCodeColor is equal to
"White" then
set properties of (story 1 of text box
(item y of mylabel) of page myPage) to {color:(color spec "Black"), shade:0}
--for Leopard
--set properties of (text box (item y
of mylabel) of page myPage) to {color:color spec color2, shade:100} --for
Leopard
end if
end tell
end
tell
---------------
Karen Nielsen
1101 Frontage Rd NW
Byron, MN 55920
Thanks Eric, but both
tell application "QuarkXPress"
make new
document at beginning
tell document 1
set cs to "Yellow"
tell page
1
make new text box at beginning with properties {bounds:{"0", "0", "11\"",
"8.5\""}}
tell text box 1
set width of frame to 2.0
set color of frame
to cs
end tell
end tell
end tell
end tell
and
tell
application "QuarkXPress"
make new document at beginning
tell document
1
tell page 1
make new text box at beginning with properties {bounds:{"0",
"0", "11\"", "8.5\""}}
tell text box 1
set width of frame to 2.0
set
color of frame to "Yellow"
end tell
end tell
end tell
end
tell
are producing the "Unknown object type." error at the "set color of
frame..." line. Weird one...
----- Forwarded
by Daniel L Turney/US/DNY on 01/08/2009 11:48 AM -----
Dan,
Change
> set cs to color spec
"Yellow" to
set cs to
"Yellow"
--or--
remove
> set cs to color spec
"Yellow"
and
change
> set color of frame to cs to
set color of frame to
"Yellow"
HTH
Eric Saunders
On
01/08/2009 at 11:28:40 AM Daniel.Turney wrote:
> Using Quark 7.3 and
7.5 under OS X 10.4.11, this code works fine:
>
> tell application
"QuarkXPress"
> make new document at beginning
> tell document
1
> set cs to color spec "Yellow"
> tell page 1
> make new
text box at beginning with properties {bounds:{"0", "0",
> "11\"",
"8.5\""}}
> tell text box 1
> set width of frame to 2.0
> set
color of frame to cs
> end tell
> end tell
> end tell
>
end tell
>
> It produces a text box with a yellow frame.
>
> Under 10.5.5 (in fact 10.5.x I think) the same code produces the
> message "QuarkXPress got an error: Unknown object type." with "set
> color of frame to cs" highlighted.
>
> If I split that
line in two:
>
> tell text box 1
> set f to frame
> set
color of f to cs
> end tell
>
> No error message appears but
the color of the frame remains
> unchanged. Has anyone experienced this
or produced a work-around?
>
> Thanks very much...
>
>
- Dan _______________________________________________
> Do not post admin
requests to the list. They will be ignored.
> AppleScript-Users mailing
list (email@hidden)
> Help/Unsubscribe/Update your
Subscription:
> .
> email@hidden
> Archives:
http://lists.apple.com/archives/applescript-users
>
> This email sent to
email@hidden
This electronic message contains
information from MeadWestvaco Corporation or
subsidiary companies, which may
be confidential, privileged or otherwise protected
from disclosure. The
information is intended to be used solely by the recipient(s)
named. If you
are not an intended recipient, be aware that any review, disclosure,
copying, distribution or use of this transmission or its contents is
prohibited. If you
have received this transmission in error, please notify
MeadWestvaco immediately
at
email@hidden.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden