Re: AppleScript in 10.9
Re: AppleScript in 10.9
- Subject: Re: AppleScript in 10.9
- From: Shane Stanley <email@hidden>
- Date: Wed, 23 Oct 2013 12:12:55 +1100
On 23 Oct 2013, at 12:02 PM, Alex Hall <email@hidden> wrote:
Okay, wow... this is huge!
Yep.
I'm off to find a regexp library
Why? NSRegularExpression is in Foundation. For simple stuff you don't even need that:
use framework "Foundation" on changeThis:findString toThat:repString inString:someText set theString to current application's NSString's stringWithString:someText set theString to theString's stringByReplacingOccurrencesOfString:findString ¬ withString:repString options:(current application's NSRegularExpressionSearch) ¬ |range|:{location:0, |length|:length of someText} return theString as text end changeThis:toThat:inString:
Commercial disclaimer: you don't get that syntax formatting outside my ASObjC Explorer.pp. |
_______________________________________________
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