• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Quark print property mismatch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: Quark print property mismatch (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: Re: text item delimiters
  • Next by Date: Re: Counting Messages in "Inbox"
  • Previous by thread: Re: Quark print property mismatch
  • Next by thread: UI Scripting - Again!
  • Index(es):
    • Date
    • Thread