• 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: RegEx Commands
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RegEx Commands


  • Subject: Re: RegEx Commands
  • From: JollyRoger <email@hidden>
  • Date: Mon, 06 Aug 2001 14:53:49 -0500

On 8/6/2001 12:30 PM, "Greg Strange" <email@hidden> wrote:

> I couldn't help golfing this one.

Whatever floats your boat.

> --begin script
>
> set someString to "ignore this
> ignore this
> ignore this
> %AI5_BeginRaster
> (Mac HD:Desktop Folder:Bear.tif) 0 XG
> ignore this
> ignore this"
>
> set {saveDelims, AppleScript's text item delimiters} to {AppleScript's text
> item delimiters, ("%AI5_BeginRaster" & return & "(")}
>
> set itemList to text items of someString
> set AppleScript's text item delimiters to ")"
> set thePic to item 1 of (text items of item 2 of itemList)
>
> log thePic
>
> --end script

You forgot to restore the text item delimiters. Add a line for that. ;^)

> Four lines to your nine. Sorry my competitive nature must be just under the
> surface today.

This isn't a competition, Greg. I never said my script was as efficient as
it could be. I left that as an exercise to the reader.


  • Follow-Ups:
    • Re: RegEx Commands
      • From: Greg Strange <email@hidden>
  • Prev by Date: Re: Script Editor 1.6 problems (and my solution)
  • Next by Date: Re: How do you make Location Manager run an app on location changes?
  • Previous by thread: Re: RegEx Commands
  • Next by thread: Re: RegEx Commands
  • Index(es):
    • Date
    • Thread