• 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: Init Caps Handler
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Init Caps Handler


  • Subject: Re: Init Caps Handler
  • From: Philip Aker <email@hidden>
  • Date: Mon, 26 Nov 2007 20:26:53 -0800

On 2007-11-21, at 07:43, Skeeve wrote:

KOENIG Yvan wrote:
Thanks I tested it with

set elan to quoted form of "élan, it's virtues are elegant kœnig lætitia ;-)"

and got a perfect:

"ÉLAN, IT'S VIRTUES ARE ELEGANT KŒNIG LÆTITIA ;-)
élan, it's virtues are elegant kœnig lætitia ;-)
Élan, it's virtues are elegant kœnig lætitia ;-)"


replace the ;-) with a ;-} and you'll get the empty string again.... As I said: Another flaw.

Sorry for the delayed reply,

Here are two other versions for you to sneak verboten Tcl characters into. 

#1 is what I prefer because there is no disk hit and can be altered to process a number of strings.

#2 is the disk hit version and will probably always be correct because it's essentially doing the same thing as the perl options in the handlers you forwarded -- save for the likelihood that perl probably mmaps the file.

Test String:

set val to quoted form of "bjOrKeD ](ü'r`}
[k$édx
"
-- 1.

set upper to do shell script "tclsh <<< 'set s [lindex $argv 1];puts [string toupper $s]' - " & val
set lower to do shell script "tclsh <<< 'set s [lindex $argv 1];puts [string tolower $s]' - " & val
set title to do shell script "tclsh <<< 'set s [lindex $argv 1];puts [string totitle $s]' - " & val
upper & return & lower & return & title

-- 2. 

set upper to (do shell script "echo -n " & val & " > /tmp/tmp.txt;tclsh <<< 'set f [open /tmp/tmp.txt];set s [read $f];close $f;puts [string toupper $s];'")
set lower to (do shell script "echo -n " & val & " > /tmp/tmp.txt;tclsh <<< 'set f [open /tmp/tmp.txt];set s [read $f];close $f;puts [string tolower $s];'")
set title to (do shell script "echo -n " & val & " > /tmp/tmp.txt;tclsh <<< 'set f [open /tmp/tmp.txt];set s [read $f];close $f;puts [string totitle $s];'")
upper & return & lower & return & title


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

 _______________________________________________
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: 
 >Init Caps Handler (From: Oakley Masten <email@hidden>)
 >Re: Init Caps Handler (From: Paul Scott <email@hidden>)
 >Re: Init Caps Handler (From: Philip Aker <email@hidden>)
 >Re: Init Caps Handler (From: KOENIG Yvan <email@hidden>)
 >Re: Init Caps Handler (From: Philip Aker <email@hidden>)
 >Re: Init Caps Handler (From: KOENIG Yvan <email@hidden>)
 >Re: Init Caps Handler (From: Skeeve <email@hidden>)

  • Prev by Date: Re: Determining
  • Next by Date: Re: Problem with osascript command
  • Previous by thread: Re: Init Caps Handler
  • Next by thread: Re: Init Caps Handler
  • Index(es):
    • Date
    • Thread