MACSCRPT Archives

May 2003

MACSCRPT@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Dr Digby L. James" <[log in to unmask]>
Reply To:
Macintosh Scripting Systems <[log in to unmask]>
Date:
Sun, 11 May 2003 23:29:36 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (70 lines)
>Try doing it for each page individually, in a loop. Likely building the
>list takes too long and takes too much memory. Untested:
>
>tell application "QuarkXPress?"
>         activate
>         tell document 1
>           repeat with i from 1 to (get count pages)
>             tell page i
>             show
>           with timeout of 600 seconds
>             set font of every character of every text box whose ¬
>              (it is "1" or it is "2" or it is "3" or it is "4" or it is¬
>               "5" or it is "6" or it is "7" or it is "8" or it is "9"
>or it is "0") ¬
>               and font is "AGaramond" to "AGaramondExp"
>           end timeout
>           end tell
>           end repeat
>           display dialog "Script completed successfully!"
>         end tell
>end tell
>
>With the "show" displaying each page in turn, you can follow its
>progress.
>


Thanks. Tried it and it failed on the first page. I've done some
messing around and came up with this, which seems to work:

tell application "QuarkXPress"
        activate
        tell document 1
          repeat with i from 1 to (get count pages)
            tell page i
            show
              try
                set (font of every character of every story whose ¬
                (it is "1" or it is "2" or it is "3" or it is "4" or it is ¬
                 "5" or it is "6" or it is "7" or it is "8" or it is
"9" or it is "0") ¬
                and font is "AGaramond") to "AGaramondExp"
              end try
            end tell
          end repeat
        display dialog "Script completed successfully!"
        end tell
end tell

I did add a blank on error section, but this was stripped out and it
ran fine. My thought is that if it finds no numbers to change the
font of that triggers an error and so the script aborts. Being a
novice at this it seems the best guess. Anyway, it's working at
present. Many thanks.
--
_________________
Dr Digby L. James
Quinta Press
http://www.quintapress.com
Meadow View
Weston Rhyn
Oswestry
Shropshire
England
SY10 7RN
Phone (44)(0)1691 778659
Mobile (44) (0)7970 678144
Fax (44)(0)1691 777638
_________________

ATOM RSS1 RSS2