Regular alphabet to phonetic alphabet (code)

i wrote this, not sure what it might be useful for, but I thought I submit it anyways…


property realalphabet : "abcdefghijklmnopqrstuvwxyz0123456789,.?!,@#$%&*-+=^/\\:()\"~£_';><|{}[]`¿¢âˆž"
property Phoneticalphabet : {"alpha", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel", "india", "juliett", "kilo", "lima", "mike", "november", "oscar", "papa", "quebec", "romeo", "sierra", "tango", "uniform", "victor", "whiskey", "xray", "yankee", "zulu", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "comma", "period", "question", "exclamation", "comma", "at", "hash", "cha-ching", "percent", "Ampersand", "star", "minus", "plus", "equal", "caret", "backslash", "fowardslash", "colon", "open-parentheses", "closed-parentheses", "quote", "tilde", "pound", "underscore", "single-quote", "semicolon", "greater-than", "less-than", "pipe", "open-brace", "closed-brace", "open-bracket", "closed-bracket", "backtick", "circumflex", "bullet", "infinity"}
on run {}
	set decodestring to text returned of (display dialog "Enter any string here,, or pass it to the script as a subroutine" default answer "Hello World!")
	set resolvedstring to {}
	set templist to stringtolist(decodestring, "")
	repeat with i from 1 to length of templist
		if realalphabet contains item i of templist then
			set end of resolvedstring to item (offset of (item i of templist as string) in realalphabet) of Phoneticalphabet
		else
			set end of resolvedstring to item i of templist
		end if
		
	end repeat
	return resolvedstring
end run
on stringtolist(theString, delim)
	set oldelim to AppleScript's text item delimiters
	set AppleScript's text item delimiters to delim
	set dlist to (every text item of theString)
	set AppleScript's text item delimiters to oldelim
	return dlist
end stringtolist
on ListToString(theList, delim)
	set oldelim to AppleScript's text item delimiters
	set AppleScript's text item delimiters to delim
	set alist to theList as string
	set AppleScript's text item delimiters to oldelim
	return alist
end ListToString