• 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: Select text (numeric words) between brackets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Select text (numeric words) between brackets


  • Subject: Re: Select text (numeric words) between brackets
  • From: Jan Bultereys <email@hidden>
  • Date: Wed, 09 Aug 2006 10:30:25 +0200
  • Thread-topic: Select text (numeric words) between brackets

Special thanks to kai, adam and emmanuel for helping me out.
Just for everyone who could use this I will share the script made for quark
6.5. I you want to use this script you will need to install this scripting
addition: Satimage.osax

This will add 'prices' with taxes, in this case 21 % to every selected
'number'

tell application "QuarkXPress Passport"
    tell document 1
        activate
        try
            set InputString to selection as Unicode text
            set w to words of InputString
            repeat with k from 1 to count w
                tell item k of w to set t to it & space & "(" & ((121 * it)
as integer) / 100 & ")"
                set item k of w to t & tab
            end repeat
            set contents of selection to w as string
        end try
    end tell
end tell


This will select every "number" between "parentheses" and replace it to an
other font/size/color

tell application "QuarkXPress Passport"
    tell document 1
        activate
        set b to text of current box
        set InputString to text of selection
        set c to (find text InputString in b)
        set d to ((matchPos of c) + 1)
        set e to ((matchLen of c) + (matchPos of c))
        repeat with a from 1 to 1000
            try
                set seleccion to selection
                set inputresult to (find text "\\([0-9,]+\\)" in b starting
at d with regexp)
                set d to ((matchPos of inputresult) + (matchLen of
inputresult)) as integer
                if d > e then exit repeat
                select text from character ((matchPos of inputresult) + 1)
to character ((matchPos of inputresult) + (matchLen of inputresult)) of
current box
                set nuevo to selection
                set font of nuevo to "Helvetica Condensed"
                set size of nuevo to 5
                set color of nuevo to "Black"
                set j to number of characters of b
                select seleccion

            on error
                exit repeat
            end try
        end repeat
    end tell
end tell


I hope I made somebody else happy

jan

 _______________________________________________
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

References: 
 >Re: Select text (numeric words) between brackets (From: Jan Bultereys <email@hidden>)

  • Prev by Date: Re: rsync and backup
  • Next by Date: Re: A little help with a folder cleanup script
  • Previous by thread: Re: Select text (numeric words) between brackets
  • Next by thread: Warnings from Terminal and problems running an AppleScript with osascript
  • Index(es):
    • Date
    • Thread