Re: AsciiNumber & AsciiCharacter Handlers
Re: AsciiNumber & AsciiCharacter Handlers
- Subject: Re: AsciiNumber & AsciiCharacter Handlers
- From: Arthur J Knapp <email@hidden>
- Date: Tue, 07 May 2002 08:20:09 -0400
>
Date: Mon, 6 May 2002 16:50:40 -0400
>
Subject: AsciiNumber & AsciiCharacter Handlers
>
From: Paul Skinner <email@hidden>
>
Here's a pair of handlers that might be interesting to those having
>
to call Ascii Number or Ascii Character a lot. But I couldn't even read
>
them after the copy into Mail.app, I'm sure the list server would have
>
made them come out like an explosion in a type foundry!
>
I've replaced the 'unmailable' characters with the word 'gobledygook '.
>
Just set the variable allTextCharacters to the result of this
>
snippet...
>
set chars to ""
>
repeat with i from 0 to 255
>
set chars to chars & (ASCII character i)
>
end repeat
>
--> "gobledygook" replacement text
There is a more easily maintainable solution for this that does not
require directly typing control characters into the editor:
property kStr256 : run script "
set a to {}
repeat with i from 0 to 255
set a's end to ascii character i
end
return a as string"
on FromCharCode(i)
return my kStr256's item (i + 1)
end FromCharCode
on ToCharCode(c)
tell (a reference to text item delimiters)
set {o, contents} to {contents, c}
set {i, contents} to {my kStr256's text item 1's length, o}
end tell
return i
end ToCharCode
>
We don' need no stinkin OSAXen!
If only that were true most of the time... ;-)
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
<
mailto:email@hidden>
try
<
http://mtlab.ecn.fpu.ac.jp/scripting/Jcode_osax.html>
on error number -128
end try
}
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.