• 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: Jan Bultereys <email@hidden>
  • Date: Wed, 27 Dec 2006 13:30:11 +0100
  • Thread-topic: Replace all caps into plain

Hi hans,

Yes this works, can you tell me if this modified version is the 'fastest'
approach to 'clean' a file? Many thanks for your feedback.

tell document 1 of application "QuarkXPress Passport"
    activate
    repeat with t from 1 to (count of text boxes)
        tell text box t
            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
                        --select
                        display dialog "all caps?"
                        --- do something
                    else if on styles of (get style) is {italic, all caps}
then
                        --select
                        display dialog "italic, all caps?"
                        --- do something
                    end if

                end tell
            end repeat
        end tell
    end repeat
end tell


> From: Hans Haesler <email@hidden>
> Date: Tue, 26 Dec 2006 21:40:12 +0100
> To: <email@hidden>
> Subject: Re: Replace all caps into plain
>
> 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:
> edepot.com
> Archives: http://lists.apple.com/mailman//archives/applescript-users
>
> This email sent to email@hidden

 _______________________________________________
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: Hans Haesler <email@hidden>
References: 
 >Re: Replace all caps into plain (From: Hans Haesler <email@hidden>)

  • Prev by Date: Re: Replace all caps into plain
  • 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