• 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
Routines for review: Hex <-> String
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Routines for review: Hex <-> String


  • Subject: Routines for review: Hex <-> String
  • From: julifos <email@hidden>
  • Date: Fri, 17 Jan 2003 13:18:26 +0100

Hi all!

Perhaps these routines already exists, but I did not find them, so...
I'd like to know if this works in other computer different than the mine (AS
1.9.1, OS 10.2.3)

;-)

JJ

-- / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . /
-- / . NOTE BREAK LINES & LEFT-RIGTH ANGLE QUOTES . /
-- / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . / . /

set h to "48656C6C6F2C20446F6C6C79"
hextoString(h)
stringtoHex(result) = h

on stringtoHex(this_string)
this_string as C string
try
result * 5
on error msg
return text from character 22 of msg to character -19 of msg
end try
end stringtoHex

on hextoString(t)
set z to ""
repeat with i from 1 to t's length by 252
try
set z to z & (run script "<<data cstr" & t's characters i thru
(i + 251) & "00>> as string")
on error
set z to z & (run script "<<data cstr" & t's characters i thru
-1 & "00>> as string")
end try
end repeat
z
end hextoString
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
_______________________________________________
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: Routines for review: Hex <-> String
      • From: Paul Skinner <email@hidden>
    • Re: Routines for review: Hex <-> String
      • From: Emmanuel <email@hidden>
  • Prev by Date: Re: Input for Upcoming Book
  • Next by Date: Re: Command line text substitution
  • Previous by thread: Re: Still cannot record anything in Script Editor
  • Next by thread: Re: Routines for review: Hex <-> String
  • Index(es):
    • Date
    • Thread