Friday, February 4, 2011

ASCII Check

property listofchar:{}
property listofascii:{}
set num to "1"
display dialog "Search by number or character?" buttons {"Number","Character"} default button 2
set buttonpressed to the button returned of the result
if buttonpressed is equal to "Character"
display dialog "What character?" default answer ""
set char to the text returned of the result
set cnt to ccount listofchar
repeat listofchar times
set aasci to item num of listofascii
set achar to item num of listofchar
if char is equal to achar
set ans to aasci
end if
end repeat
else if buttonpressed is equal to "Number"
display dialog "What number?" default answer ""
set num2search to the text returned of the result
set ans to ascii character num2search
end if

No comments:

Post a Comment