• 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: A Lookup Function?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A Lookup Function?


  • Subject: Re: A Lookup Function?
  • From: Christopher Stone <email@hidden>
  • Date: Mon, 24 Jan 2011 16:05:27 -0600

Hey Folks,

A minor modification in this handler to escape the '.' and appease the regular _expression_ Gods.

on phoneticLookup(someStringToLookup)
set transList to {}
set splitIt to characters of someStringToLookup
repeat with i from 1 to length of splitIt
set lookUpChar to item i of splitIt
set lookUpChar to change {"."} into {"\\."} in lookUpChar
set lookUpCharRegex to "^" & lookUpChar & "\\t+(.+)"
set end of transList to regexFindCapture(lookUpCharRegex, "\\1", lookUpTable, false, true, false, false, true) of me
end repeat
return transList
end phoneticLookup

--
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

References: 
 >A Lookup Function? (From: Marconi <email@hidden>)

  • Prev by Date: Re: Case Sensitive Format
  • Next by Date: Is it possible to set the main edit window of Adobe Photoshop Elements
  • Previous by thread: Re: A Lookup Function?
  • Next by thread: passing handler problems and a resolution
  • Index(es):
    • Date
    • Thread