Hi there,
i am trying to replace special German characters in a string with ordinary ASCII chars.
After some digging I borrowed some code to do the needed work.
The problem with it is, that it doesn’t replace chars like ‘ü’.
Someone got an idea how to solve this Problem with appleScript?
Tanks in advance and Greetings from Germany,
Thomas
I tried to simplify my code as much I could:
set myFile to choose file
tell application "Finder" to set fileName to name of myFile
set fileName to snr(fileName, "ü", "ue")
display dialog fileName
on snr(the_string, search_string, replace_string)
return my list_to_string((my string_to_list(the_string, search_string)), replace_string)
end snr
on list_to_string(the_list, the_delim)
my atid(the_delim)
set the_string to (every text item of the_list) as string
my atid("")
return the_string
end list_to_string
on string_to_list(the_string, the_delim)
my atid(the_delim)
set the_list to (every text item of the_string) as list
my atid("")
return the_list
end string_to_list
on atid(the_delim)
set AppleScript's text item delimiters to the_delim
end atid