• 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: Replace all caps into plain
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Replace all caps into plain


  • Subject: Re: Replace all caps into plain
  • From: Hans Haesler <email@hidden>
  • Date: Tue, 26 Dec 2006 21:40:12 +0100

On Tue, 26 Dec 2006, Jan Bultereys wrote:

>I would like  to select every text which has "all caps" as style
>and replace it with plain:

Jan,

you don't need to select anything.
---
tell document 1 of application "QuarkXPress Passport"
  activate
  tell text box 1
    tell every text style range
      set style to {plain}
    end tell
  end tell
end tell
---

When using a test you must loop through the text
style ranges. Backwards, because their number might
change while running the script.
---
tell document 1 of application "QuarkXPress Passport"
  activate
  tell text box 1
    repeat with i from (count of text style ranges) to 1 by -1
      tell text style range i
        if on styles of (get style) is {all caps} then
          set style to {plain}
        end if
      end tell
    end repeat
  end tell
end tell
---

Regards,
Hans


 _______________________________________________
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/mailman//archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Replace all caps into plain
      • From: Jan Bultereys <email@hidden>
  • Prev by Date: Re: Getting pid and error from do shell script
  • Next by Date: Re: Replace all caps into plain
  • Previous by thread: Re: Replace all caps into plain
  • Next by thread: Re: Replace all caps into plain
  • Index(es):
    • Date
    • Thread