• 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: AsciiNumber & AsciiCharacter Handlers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: AsciiNumber & AsciiCharacter Handlers
      • From: Paul Skinner <email@hidden>
  • Prev by Date: Re: Translate a code of 2 characters to a text
  • Next by Date: Re: Setting Default Browser in OS X
  • Previous by thread: Re: AsciiNumber & AsciiCharacter Handlers
  • Next by thread: Re: AsciiNumber & AsciiCharacter Handlers
  • Index(es):
    • Date
    • Thread