AppleScript: string 2 hex konvertieren

-- convert string to hex value
on string2hex(this_String)
  set hex to ""
  repeat with i from 1 to count of this_String
    set hex to hex & char2hex(character i of this_String)
  end repeat
  return hex as string
end string2hex