better text processing commands [Re: "read from" and non-lo-ascii characters]
better text processing commands [Re: "read from" and non-lo-ascii characters]
- Subject: better text processing commands [Re: "read from" and non-lo-ascii characters]
- From: has <email@hidden>
- Date: Thu, 23 Jun 2005 23:42:41 +0100
Paul Berkowitz wrote:
>Even more welcome would be similar commands for "Unicode hex character",
>"Unicode decimal character", "Unicode hex code" and "Unicode decimal code".
>They'd all have to be strings, except maybe "Unicode decimal code",
Using TextCommands <http://freespace.virgin.net/hamish.sanderson/index.html#textcommands>:
- Unicode hex character(s):
convert to unicode (unpack hexString using hex encoding) from "utf16"
--> Unicode text
- Unicode decimal character(s):
unicode characters integerList
--> unicode text
- Unicode hex code(s):
pack (convert from unicode unicodeText to "utf16") using hex encoding
--> hex string (including BOM)
- Unicode decimal code(s):
unicode numbers unicodeText
--> list of integer
>the first two aren't even possible until AppleScript can compile Unicode text.
You can muck about with «data utxt...» (OS10.3.?+ IIRC; crashes on earlier AS versions), or you can use TextCommands' literal command to convert string literals containing %-escapes to unicode values, either at compile-time or runtime (much nicer).
I'm currently working on TextCommands' documentation, and the next release (0.6.0) will be the beta before the final v1 release, so if anyone's got any more feature requests then now's a good time to send them over. I could also really do with some beta testers just to be sure everything's tickety-boo before it goes final. Once it's done I'll see about getting it hosted somewhere permanent and high-profile like MacScripter; I'll also release the source to future-proof against any proverbial buses. It wraps a considerable chunk of Python's powerful and robust text processing facilities as a free scriptable FBA, and I hope every AppleScripter will get a copy; it's something that's _long_ overdue.
has
--
http://freespace.virgin.net/hamish.sanderson/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden