Re: Reformatting a string
Re: Reformatting a string
- Subject: Re: Reformatting a string
- From: Shane Stanley <email@hidden>
- Date: Mon, 30 Jan 2012 23:17:47 +1100
On 30/01/2012, at 10:19 PM, Thomas Fischer wrote:
> I would be glad to know how this compares to the other options. Shane, can you check this?
It's faster than SmartStrings, but it still has the same problem of taking ages with longer strings. I tried a 5Kb string before I started typing this reply, and it's still running[1] -- Satimage and ASObjC Runner took between 1 and 3 seconds for the same thing. I just can't see any amount of clever tweaking bridging that sort of gap.
> I get an empty string outText as a result: the aChar copied to the end of the list isn't a character anymore.
> theChars and the list outText look identical, but aren't. Is this a bug or a feature?
This is known behavior: outText is a list of references, not characters. They're getting resolved in logging, but not in the coercion to text.
>
> By the way, there is an error in Yvan's solution: if you
>> set unID to id of unCarac
> then unID isn't necessarily a number
SmartString makes the same assumption, so it will break there too.
This really underlines why, IMO, this should be built into AS. It's not really the speed -- AS is slower, and we all know that and live with it. It's just that it's so easy to get wrong, even by people who know AS back-to-front and inside-out, and in ways that appear to be working.
It's not like it would involve a lot of code; it just has to pass on the functionality of Cocoa strings, which use the ICU library to do it all in open-source C.
FWIW, I broke down and logged a feature request on bugreporter requesting lowercase/uppercase commands. I'm not holding my breath, but maybe a modest chorus would bring it to someone's attention.
> So if you want to have full control of the action and no additional software installed
Keep in mind that using AppleScriptObjC and saving as a Cocoa-AppleScript app technically meets that spec, at least for apps.
[1] I knew if I typed long enough: 1017 seconds.
--
Shane Stanley <email@hidden>
'AppleScriptObjC Explored' <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