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

AsciiNumber & AsciiCharacter Handlers


  • Subject: AsciiNumber & AsciiCharacter Handlers
  • From: Paul Skinner <email@hidden>
  • Date: Mon, 6 May 2002 16:50:40 -0400

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


on asciiCharacter(parameters)
set allTextCharacters to "gobledygook"
return item (parameters + 1) of allTextCharacters
end asciiCharacter


on asciiNumber(parameters)
set allTextCharacters to "gobledygook"
set AppleScript's text item delimiters to parameters
set temp to (every text item of allTextCharacters)
set AppleScript's text item delimiters to ""
set ind to (length of (item 1 of temp))
end asciiNumber


I get speed comparisons of...
22sec for 10K ascii number commands.
5 sec for 10K asciiNumber() calls.

21 sec for 10K ascii character commands.
1 sec for 10K asciiCharacter() calls!

No error checking or multiple argument capacity in this version. Just a speed test really.
--
Paul Skinner
OS version 10.1.4. Applescript verion 1.8.2b

We don' need no stinkin OSAXen!
jk, yes we do
_______________________________________________
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.

  • Prev by Date: Re: OS X: Styled text to plain text???
  • Next by Date: Math Commands
  • Previous by thread: Re: OS X: Styled text to plain text???
  • Next by thread: Re: AsciiNumber & AsciiCharacter Handlers
  • Index(es):
    • Date
    • Thread