UnicodeChecker Icon

AppleScript

A number of UnicodeChecker's features are available for use in your AppleScripts:

The documentation for scripting support can be viewed from Script Editor’s “Open Dictionary…” menu command.

To get an idea of what you can do, have a look at the AppleScript sample.

Additional Notes

Some additional information which can not be found in UnicodeChecker’s AppleScript dictionary.

Performance and Memory Usage

Currently, Unicode contains 1114112 code points. Querying the complete set of code points for specific properties (e.g. code points where unicode name contains "latin") may therefore be time and memory consuming. When waiting for a command to return, AppleScript times out after a specific amount of time. If your script times out you can use AppleScript’s with timeout statement to influence how long AppleScript waits. More information on the with timeout statement can be found in the AppleScript documentation here and here. However, when performing lengthy commands UnicodeChecker also uses quite a lot of memory – sometimes the memory requirement may reach 1 GB or more. To reduce time and memory requirements of your script you can try to restrict queries to smaller code point sets (e.g. querying either individual planes or blocks). If you need to query the whole codespace, it may be better to use a repeat statement to iterate over all planes and query each plane individually inside the repeat loop.

Class code point

Class plane

Similar to code point, be careful not to confuse ID and index when referring to individual planes: plane id 0 is identical to plane 1, etc.

Unicode Strings in AppleScript on Mac OS X 10.6 and Later

As of Mac OS X 10.6 (Snow Leopard), the AppleScript-Editor correctly handles Unicode strings.

Unicode Strings in AppleScript on Mac OS X 10.5 and earlier

On Mac OS X 10.5 (Leopard) and earlier, using Unicode strings in AppleScript is not trivial: For example, when you enter set theText to "⅋" in Script Editor it will be replaced by set theText to "?". As a workaround you can enter the hexadecimal UTF-16 or UTF-8 codes to produce Unicode strings:

There is a caveat to this: Although AppleScript also accepts set theText to «data utxt214B» without the coercion as Unicode text, the resulting string is different on Intel and PowerPC Macs. This is due to the different endian-ness of Intel and PowerPC processors. So it is a good idea to always use («data utf8…» as Unicode text) which will produce identical strings on both architectures.

Are you using AppleScript?

We are interested in how you use UnicodeChecker's AppleScript support. So drop us a line and let us know which AppleScript features you find particularly useful and which you'd like to see in future versions.