• 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: Changing Quark text styles and fonts
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing Quark text styles and fonts


  • Subject: Re: Changing Quark text styles and fonts
  • From: "Dr Digby L. James" <email@hidden>
  • Date: Wed, 19 Jan 2005 23:14:15 +0000

Title: Re: Changing Quark text styles and fonts
I went away and had a snooze and came up with the following, which works document wide, though it's not very elegant. I'm sure there's a better way of doing this. And is there a way of finding style which might have other attributes without specifying them (contains italic does not find, for example, bold italic text).

tell application "QuarkXPress"
   tell every story of document 1
      try
      --italic
         tell (text style ranges whose font is "Sabon OS Figs MT" and style contains italic)
            set font to "Sabon MT ItalicOSF"
         end tell
         tell (text style ranges whose font is "Sabon MT ItalicOSF" and style contains italic)
            set style to {off styles:{italic, bold}}
         end tell
         --bold
         tell (text style ranges whose font is "Sabon OS Figs MT" and style contains bold)
            set font to "Sabon MT SemiBoldOSF"
         end tell
         tell (text style ranges whose font is "Sabon MT SemiBoldOSF" and style contains bold)
            set style to {off styles:{italic, bold}}
         end tell
         --bold-italic
         tell (text style ranges whose font is "Sabon OS Figs MT" and style contains {on styles:{bold, italic}})
            set font to "Sabon MT SemiBoldItalicOSF"
         end tell
         tell (text style ranges whose font is "Sabon MT SemiBoldItalicOSF" and style contains {on styles:{bold, italic}})
            set style to {off styles:{italic, bold}}
         end tell
      end try
   end tell
   display dialog "Script completed"
end tell

I regularly need to change italic, bold and bold/italic text into the correct italic, etc. font as the font family used isn't recognised as such and applying italic, etc. results in faux characters. Up to now I have just used Quark's Find/Change dialog and done it manually, but I'd like to Applescript it to save time, and also so a colleague (who's a great designer but useless with software) will be able to do it easily too.

>From previous experience and reading posts here and checking web-sites I thought the following would work:

tell application "QuarkXPress"
   tell current box
      try
         set properties of (text style ranges of stories whose font is {"Sabon OS Figs"} ¬
            and style contains {italic, bold}) to {font:"Sabon MT ItalicOSF", ¬
               on styles:{plain}, off styles:{italic, bold}}
      end try
   end tell
   display dialog "Script completed"
end tell

Clearly (or I wouldn't be asking!) this doesn't work. I've also tried "if" statements and looping tgrough the number of text style range, all to no avail. The only one that slightly works is to go word by word or character by character (set properties of every character whose . . .). But all that does is to change the font of the *last* instance. And it doesn't set the style to plain, only change the font.


--
_________________
Dr Digby L. James
Quinta Press
http://www.quintapress.com
_________________
 _______________________________________________
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

  • Prev by Date: Re: weird path to me error
  • Next by Date: Re: Delaying a script
  • Previous by thread: Changing Quark text styles and fonts
  • Next by thread: "Where is application ...?" dialog stopping automation
  • Index(es):
    • Date
    • Thread