• 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: Creating a list
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating a list


  • Subject: Re: Creating a list
  • From: Christopher Stone <email@hidden>
  • Date: Sun, 30 Aug 2009 10:11:13 -0500

On Aug 29, 2009, at 16:36, Peter Baxter wrote:
I'm trying to create a list from a text file of every word in it that has 5 characters.  This shouldn't be so hard, but I keep failing in the task. Can anyone help?
______________________________________________________________________

Hey Peter,

Personally I'd use the Satimage osax and regular expressions:

set n to "Now is the time for all good men to come to the aid of their country."

set findData to n
set findString to "\\b[a-z]{3}\\b"

set theResult to ¬
find text findString ¬
in findData ¬
case sensitive false ¬
regexp true ¬
all occurrences true ¬
with string result

The example finds 3-letter words.  Change '{3}' to '{5}' in the example for 5-letter words.

Chris
 _______________________________________________
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/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Creating a list
      • From: Yvan KOENIG <email@hidden>
References: 
 >Creating a list (From: Peter Baxter <email@hidden>)

  • Prev by Date: Re: TID's in Snow Leopard
  • Next by Date: Re: Creating a list
  • Previous by thread: Re: Creating a list
  • Next by thread: Re: Creating a list
  • Index(es):
    • Date
    • Thread