On 2009-09-25, at 14:05:18, Luther Fuller wrote:
I should have paused before clicking send.
Take a look at Apple's Calculator!
The bug here is that it's not scriptable!
It doesn't have to be for this use. Find the hex values you need from the unicode tables, then convert them to decimal values to write into your script.
set fname to "éxotic_ïtem_àppellation"
do shell script "tclsh <<< 'set nu [string map {_ { }} {" & fname & "}];foreach w $nu {lappend rslt [string totitle $w]};puts $rslt'"
I believe the points are:
1. With Perl code like Mark Reed sent or the above Tcl, your solution to the OP's problem appears to be unreliable, overly verbose, and would require excessive effort to complete.
2. The inner problem of converting to and from Unicode character values is again solved neatly by built-in shell script facilities.
3. Considering the occasional usefulness of Calculator.app for conversions and calculations AppleScript does not support, and Apple's boast that it's easy as pie to script Cocoa applications, it's a bug that Calculator doesn't even implement minimal scripting support.