Re: Quark print property mismatch
Re: Quark print property mismatch
- Subject: Re: Quark print property mismatch
- From: Brett Conlon <email@hidden>
- Date: Fri, 20 Jan 2006 09:42:09 +1000
Hi Paul,
Many thanks for your response. I have
to say, tho, that you're assuming I know what the hell I'm doing. ;-}
I clearly don't! So with that out of the way.....
You're right, if someone chose "Custom"
the script would fail. I actually had a try statement set up in my script
but I didn't include it in my email as I wanted my code to focus on just
the problem. But I should have known that you adroit scripters would pick
it up. ;-D Here's what I had:
try
set
pSize to
first
word of
PaperSize
set
pOrient to
word 2 of
PaperSize
end
try
It's simple and I don't mind if "Custom"
isn't accounted for because Custom doesn't have an "Orientation"
setting, just a page width and height measurement. The other code takes
care of the custom setting. I still have some fiddling with it but your
suggested code for setting "Portrait" to portrait worked... as
simple as that - see I don't really know what I'm doing but I'm slowly
getting there and I guess that's all that matters.
Thanks again for getting me back on
the road again. Unfortunately my driving skills will lead me to requiring
further assistance in the near future. <8-{
Cheers,
Cojcolds
Paul Berkowitz <email@hidden>
Isn't it possible to have what return portrait? (Why "return"?)
It's returning what you gave it, namely word 2 of the string "A4
Portrait", which is a string "Portrait". In quotes, naturally.
(By the way, you've surely set yourself up for an error if the user chooses
"Custom", since there's no word 2.)
Naturally 'choose from list' needs strings (or Unicode). I don't have Quark,
but if portrait' (no quotes) is an enumeration or property there, it ought
to compile inside a Quark tell block (which you have omitted, for some
reason). Then you can
tell app "Quark XPress" -- or whatever it's called
set PaperSize to item 1 of (choose from
list {"A4 Portrait", "A4 Landscape", "A3 Portrait",
"A3 Landscape", "Custom"} with prompt "Choose
the appropriate PDF paper size:")
set pSize
to first word of PaperSize
try
set pOrient
to word 2 of PaperSize
on error
set pOrient to "Custom" --
or whatever it ought to be
end try
if pOrient = "Portrait then
set pOrient to portrait
else if pOrient = "Landscape" then
set pOrient to landscape
else if ...
--etc
end if
tell document 1
set properties of print setup
to ¬
--- etc
end tell
end tell
The other way to do it would be to
set pOrient to run script pOrient
but that can lead you into trouble under some circumstances.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden