• 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, 02 Aug 2006 14:47:29 +0200
  • Thread-topic: Select text (numeric words) between brackets

Thanks Emmanuel,

Is there a syntax which selects every text with brackets?
ideal would be no words but only numbers.

This is what I have now:
tell application "QuarkXPress Passport"
    tell document 1
        activate
        try
            set InputString to selection as string
            find text "\\([^]]+\\)" in InputString with regexp and string
result
        end try
    end tell
end tell

This is the return: (example)
find text "\\([^]]+\\)" in "12,63 (15,28)    11,49 (13,90)    10,36 (12,54)
8,44 (10,21)" with regexp and string result
        "(15,28)    11,49 (13,90)    10,36 (12,54)    8,44 (10,21)"

Why does it only grap the first number which is (15,28) and the other
numbers I did not want to be returned?

I expect (in this example) a return like this:
"(15,28) (13,90) (12,54) (10,21)"

Then my idea would be to return this to quark and replace the font of these
numbers....

Any feedback is much appreciated
jan



> From: Emmanuel <email@hidden>
> Date: Wed, 2 Aug 2006 01:47:44 +0200
> To: "email@hidden" <email@hidden>
> Subject: Re: Select text (numeric words) between brackets
>
> At 5:44 PM +0200 8/1/06, Jan Bultereys wrote:
>> Does anyone knows how to grap a text which is between brackets
>> (brackets also selected)?
>
> That's a job for a regular expression. You want:
>
> find text (or: ufind text for Unicode) "\\[[^]]+\\]" with regexp and
> string result
>
> "find text" is in Satimage osax, "ufind text" is in Smile.
>
> Emmanuel
>  _______________________________________________
> 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
>
> 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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Select text (numeric words) between brackets
      • From: Emmanuel <email@hidden>
References: 
 >Re: Select text (numeric words) between brackets (From: Emmanuel <email@hidden>)

  • Prev by Date: Batch Add users in Open Directory
  • Next by Date: Re: Launch Services info (was "Re: Auto-Remove .DS_Store Files?")
  • Previous by thread: Re: Select text (numeric words) between brackets
  • Next by thread: Re: Select text (numeric words) between brackets
  • Index(es):
    • Date
    • Thread