Re: What's in a word
Re: What's in a word
- Subject: Re: What's in a word
- From: John McClintock <email@hidden>
- Date: Thu, 18 Oct 2012 08:23:39 -0400
Hooray, I set my word breaks to English, and I see the expected behavior.
In this case I'm the only user of the script so not yet worried about generalizing it...
I love grep, but it makes my brain itch, especially wrapped into AppleScript. I also love the
simplicity of word counting, if it works consistently. NASA image directories follow simple rules,
so it's been pretty easy to scrape files by date, time, instrument, etc.
Thanks to everyone for the helpful and interesting responses. What a great group!
John McClintock
email@hidden
On Oct 17, 2012, at 11:40 PM, Jon Pugh <email@hidden> wrote:
> On Oct 17, 2012, at 10:03 AM, John McClintock wrote:
>> In the following, why is word -1 of a_url "jpg" and word -1 of the_url the whole file name?
>>
>> set a_url to "http://stereo-ssc.nascom.nasa.gov/browse/2009/08/02/ahead/euvi/195/1024/20090802_001530_n7euA_195.jpg"
>> set the_url to "http://stereo.gsfc.nasa.gov/browse/2012/10/09/ahead/cor1/1024/20121009_001024_s4c1A.jpg"
>>
>> display dialog "Word -1 of a_url is " & word -1 of a_url & return & "Word - 1 of the_url is " & word -1 of the_url
>>
>> ?
>
> In the System Preferences => Language & Test pane => Text tab, there is a popup named Word Break and it can be set to “Standard” which produces the behavior you observe. If you set it to “English (United States, Computer)” then you’ll see the behavior you expect (once you recompile your script).
>
> Credit goes to Chris Page who explained it to me.
>
> Jon
>
>
_______________________________________________
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