• 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: Questions on approach
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Questions on approach


  • Subject: Re: Questions on approach
  • From: Christopher Stone <email@hidden>
  • Date: Mon, 15 Nov 2010 21:39:52 -0600

On Nov 15, 2010, at 21:02, Brian Christmas wrote:
The trouble wasn't setting the color in the mail messages, the trouble was reading the xth value of the string where x was large.
______________________________________________________________________

Hey Brian,

It's not vanilla of course, but I'd much rather use the Satimage.osax for such things (script appended).

On the vanilla side a couple of things worth noting are:

offset of "•" in dataSrc

"•" is in dataSrc

All of these run quite quickly on a MegaByte of text on my machine (MacBook Pro i7).

--
Chris


on fnd(findStr, dataSrc, caseSensitive, allOccurrences, stringResult)
  find text findStr in dataSrc ¬
    case sensitive caseSensitive ¬
    all occurrences allOccurrences ¬
    string result stringResult ¬
    with regexp
end fnd

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

try
  set foundRecord to fnd("•", dataSrc, false, true, false)
on error errMsg number errNum
  beep
  tell me to display dialog "Error: " & errMsg & return & "Error Number: " & errNum
end try

--> Result:
(*
{
  {
    matchPos:24, 
    matchLen:1, 
    matchResult:"•"
  }, 
  {
    matchPos:29, 
    matchLen:1, 
    matchResult:"•"
  }
}
*)

 _______________________________________________
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: Questions on approach
      • From: Brian Christmas <email@hidden>
References: 
 >Questions on approach (From: Alex Zavatone <email@hidden>)
 >Re: Questions on approach (From: Brian Christmas <email@hidden>)

  • Prev by Date: Re: Questions on approach
  • Next by Date: Re: Questions on approach
  • Previous by thread: Re: Questions on approach
  • Next by thread: Re: Questions on approach
  • Index(es):
    • Date
    • Thread