Re: is Shane's advice being collated?
Re: is Shane's advice being collated?
- Subject: Re: is Shane's advice being collated?
- From: Shane Stanley <email@hidden>
- Date: Thu, 20 Nov 2014 13:51:27 +1100
On 19 Nov 2014, at 11:22 pm, 2551 <email@hidden> wrote:
>
> try comparing two strings for equivalence in Objective C and in AppleScript, for example. Damned site easier in the latter
Interesting that you brought this up now.
So for lurkers, the difference is something like:
if x = y then
vs:
if (x's isEqualToString:y) as boolean then
Less typing, but I don't know that it's significantly "easier". However, there are differences in terms of how they handle case and diacriticals -- the ASObjC code looks for strict equality, and it definitely gets more complicated if you don't care about case, for example.
But just recently been discussing ASObjC off-list with a list regular, Takaaki Naganoya. I don't think he will mind if I quote one of his replies:
> The String compare is our headache problem for Japanese AppleScript users.
> AppleScript system treats many different characters as same one. Katakana, Hiragana, some special characters..they are same characters (with NFKC Casefold rule in Unicode).
>
> So, I want to compare strings exactly. “isEqualToString:” should be a right way.
>
> Thanks!
So one user's easier is another user's headache.
And the real point is that Takaaki now has an alternative.
(I don't speak Japanese, but his Web site has lots of ASObjC snippets and comparisons, if anyone is interested: <http://piyocast.com/as/>.)
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
_______________________________________________
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