on open (DroppedList)
	
	repeat with n from 1 to count of DroppedList
		try
			tell application "Finder"
				set myOrigName to name of file (item n of DroppedList)
			end tell
		on error
			display dialog "Der Name der einer der Dateien konnte nicht gelesen werden."
		end try
		
		set myNewName to GetTextForName(myOrigName)
		
		if myNewName is not "" then
			try
				tell application "Finder"
					set name of file (item n of DroppedList) to myNewName
				end tell
			on error
				try
					tell application "Finder"
						set name of file (item n of DroppedList) to (myNewName & " -2")
					end tell
				on error
					display dialog "Die Datei \"" & myOrigName & "\" konnte nicht in " & myNewName & " umbenannt werden."
				end try
			end try
		else
			display dialog "Der Name der Datei \"" & myOrigName & "\" konnte nicht konvertiert werden."
		end if
	end repeat
	
end open


on GetTextForName(myText)
	set myShellScript to ¬
		"echo '" & myText & "' | iconv -f UTF8-MAC -t MACROMAN | iconv -f SHIFT_JIS -t UTF8"
	return do shell script myShellScript
end GetTextForName