• 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
Pseudo-regexp
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Pseudo-regexp


  • Subject: Pseudo-regexp
  • From: Elliotte Harold <email@hidden>
  • Date: Mon, 28 Feb 2005 14:52:20 -0500

A few of you may remember my efforts to work around Mozilla's poor scriptability relative to Eudora. A few months later. I've almost got the problem licked. The key was using GUI scripting to directly manipulate Mozilla's menus rather than trying to query the windows for their contents. Thus, I copy and paste the content I need into AppleScript. It's an ugly, ugly hack but it works, at least some of the time.

The final step is to parse the From: and Date: headers out of the raw message text. This is pretty straight-forward string manipulation, and I I'm hoping it's obvious to someone. In other words, I have this:

...
Message-ID: <email@hidden>
Date: Mon, 28 Feb 2005 10:43:14 -0800 (PST)
From: rlk groups <email@hidden>
To: email@hidden
MIME-Version: 1.0
...

I have this complete message stored in a string variable called rawmessage.

I need to extract "rlk groups <email@hidden>" and "Mon, 28 Feb 2005 10:43:14 -0800 (PST)" and store them in new variables.

Regular expressions would make this task easy, but as far as I know (I could be wrong about this) AppleScript doesn't have these without 3rd party libraries. Is there any straightforward string operations that could pull this off?

If there's not, is there an easy way to call out to Perl or some such to do this work?

And if that's not the case, what's the best cheap regex library for AppleScript? SatImage?

For what it's worth this does not run unattended. I can afford a quick and dirty solution that may fail on some corner cases and have to be manually corrected.

All suggestions are appreciated.

--
Elliotte Rusty Harold  email@hidden
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim

_______________________________________________
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: Pseudo-regexp
      • From: Gnarlodious <email@hidden>
    • Re: Pseudo-regexp
      • From: Adam Wuellner <email@hidden>
  • Prev by Date: Re: creation date property of item is r/o !
  • Next by Date: Re: Getting the version of a product
  • Previous by thread: Recording hangs
  • Next by thread: Re: Pseudo-regexp
  • Index(es):
    • Date
    • Thread