• 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 16:34:59 +0100
  • Thread-topic: Replace all caps into plain

Yes, and also some kind of control about what happened on the page...

I have extended the script already and can you give me a tip to "zoom in" to
the 'hit' I would like to "zoom in" 300 % to the selection... Many thanks
again. (if you want to run this you need scripting addition Satimage.osax)

tell document 1 of application "QuarkXPress Passport"
    activate
    repeat with s from 1 to (count of stories)
        tell story s
            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 objRef to object reference
                        my selText(objRef)
                        set bR to button returned of (display dialog "The
text is --all caps--" buttons ¬
                            {" Cancel ", "Keep", "Make Real Caps"} default
button 3)
                        if bR is "Make Real Caps" then
                            my setPlain(objRef)
                        else if bR is " Cancel " then
                            error number -128
                        end if
                    else if on styles of (get style) is {italic, all caps}
then
                        set objRef to object reference
                        my selText(objRef)
                        set bR to button returned of (display dialog "The
text is --Italic and all caps--" buttons ¬
                            {" Cancel ", "Keep", "Make Real Caps"} default
button 3)
                        if bR is "Make Real Caps" then
                            my setPlain(objRef)
                        else if bR is " Cancel " then
                            error number -128
                        end if
                    else if on styles of (get style) is {small caps} then
                        set objRef to object reference
                        my selText(objRef)
                        set bR to button returned of (display dialog "The
text is --small caps--" buttons ¬
                            {" Cancel ", "Keep", "Make Real Caps"} default
button 3)
                        if bR is "Make Real Caps" then
                            my setPlain(objRef)
                        else if bR is " Cancel " then
                            error number -128
                        end if
                    else if on styles of (get style) is {italic, small caps}
then
                        set objRef to object reference
                        my selText(objRef)
                        set bR to button returned of (display dialog "The
text is --Italic and small caps--" buttons ¬
                            {" Cancel ", "Keep", "Make Real Caps"} default
button 3)
                        if bR is "Make Real Caps" then
                            my setPlain(objRef)
                        else if bR is " Cancel " then
                            error number -128
                        end if

                    end if
                end tell
            end repeat
        end tell
    end repeat
end tell

on selText(objRef)
    tell application "QuarkXPress Passport"
        set selection to objRef
    end tell
end selText

on setPlain(objRef)
    tell application "QuarkXPress Passport"
        tell objRef
            set style to plain
        end tell
        set objRef to selection as string
        set UpSTR to change ¬
            {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l",
"m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "é",
"è", "ç", "à", "œ", "ê", "î", "â", "ë", "û", "ü", "ù", "ï", "ô"} ¬
                into ¬
            {"A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L",
"M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "É",
"È", "Ç", "À", "Œ", "Ê", "Î", "Â", "Ë", "Û", "Ü", "Ù", "Ï", "Ô"} ¬
                in objRef
        set contents of selection to UpSTR
    end tell
end setPlain








> From: Hans Haesler <email@hidden>
> Date: Wed, 27 Dec 2006 16:32:12 +0100
> To: <email@hidden>
> Subject: Re: Replace all caps into plain
>
> On Wed, 27 Dec 2006, Jan Bultereys wrote:
>
>> I would like to show a dialog box only IF there is a hit...
>> I want pages without these "electronical" fonts to go fast...
>
> What is the point of showing the dialog? Do you need
> to see the selection and--depending what it is--decide to
> change the style to plain or leave it as it is?
>
>
> 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>
    • Re: Replace all caps into plain
      • From: Emmanuel <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