on open ThisFile
set AppleScript's text item delimiters to ":"
set InText to the last text item of (ThisFile as text)
set ParentFolder to ((text items 1 thru -2 of (ThisFile as text)) as string) & ":"
set AppleScript's text item delimiters to ""
set InTextList to every character of InText
set OutText to ""
repeat with the_character in InTextList
if ¬
the_character is greater than or equal to "1" and the_character is less than or equal to "9" or ¬
the_character is greater than or equal to "a" and the_character is less than or equal to "z" then
set OutText to OutText & the_character
else
set OutText to OutText & "_"
end if
end repeat
set OutText to OutText as Unicode text
set ThisFile to ThisFile as Unicode text
set ParentFolder to ParentFolder as Unicode text
tell application "Finder"
set the name of ThisFile to ParentFolder & OutText
end tell
end open
I’m a clueless noob with only a week of experience. A hint would be appreciated.
Model: G5
AppleScript: 1.10.7
Browser: Safari 419.3
Operating System: Mac OS X (10.4)