• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Manipulating text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Manipulating text


  • Subject: Re: Manipulating text
  • From: Philip Aker <email@hidden>
  • Date: Fri, 25 Sep 2009 15:14:39 -0700

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.


Philip Aker
echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

 _______________________________________________
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

References: 
 >Manipulating text (From: Jim Brandt <email@hidden>)
 >Re: Manipulating text (From: Luther Fuller <email@hidden>)
 >Re: Manipulating text (From: Philip Aker <email@hidden>)
 >Re: Manipulating text (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Manipulating text
  • Next by Date: Re: Manipulating text
  • Previous by thread: Re: Manipulating text
  • Next by thread: Re: Manipulating text
  • Index(es):
    • Date
    • Thread