• 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: Keyboard Question?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keyboard Question?


  • Subject: Re: Keyboard Question?
  • From: "Arthur J Knapp" <email@hidden>
  • Date: Fri, 19 Jan 2001 11:31:56 -0500

> Date: Thu, 18 Jan 2001 22:38:45 -0800
> Subject: Re: Keyboard Question?
> From: Paul Berkowitz <email@hidden>

> FORM. The hex/octal discussion has been an interesting red herring.

Why does Tim Curry come to mind every time I hear "red herring" ???

> I earlier provided a script which will give you every ASCII character from
> 32 through 255, but not 0 to 31. I still think it's the easiest way to get

From time to time, I have had a need to have some portion of the Mac
character set available to a script. When I need such a list/string, I
find that it saves on runtime execution to create compile-time
properties with the "run script" command:


-- For large strings, it is often faster to avoid repeated
-- operations involving the ASCII commands, so we use them
-- only during compile.
--
property kControlChars : run script ,
"set lst to {}
repeat with i from 0 to 31
set end of lst to ASCII character i
end repeat
return lst as string"

on ZapControlChars(str)

set str to characters of str -- listify

repeat with c in str

-- Since we are not using the ASCII commands, we have to
-- be careful about AppleScript's comparison operations.
--
considering case, diacriticals, expansion, hyphens, punctuation and
white space
if (kControlChars contains c) then set c's contents to 0
end considering
end repeat

return (plain text of str) as string

end ZapControlChars


ZapControlChars("Dude" & (ASCII character 5) & "Guy")


--
{
Arthur J Knapp, of STELLARViSIONs ;

http://www.STELLARViSIONs.com ;

mailto:email@hidden ;

"...well the rain falls down
without my help, I'm afraid
and my lawn gets wet,
though I withheld my consent..."
}


  • Follow-Ups:
    • Re: Keyboard Question?
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: Xpress 4.1 and group box type
  • Next by Date: Re: ASCII
  • Previous by thread: Re: Keyboard Question?
  • Next by thread: Re: Keyboard Question?
  • Index(es):
    • Date
    • Thread