Hi
I have an applescript that I found and was wondering how I can make it work on files and folders within others folders. At the moment it only effects the top level folder and not what is contained within it.
I'm am moving files onto a windows/unix server and the files will not currently copy because of the illegal characters.
Would really appreciate the help
Thanks
D
Here is the applescript code:
I have an applescript that I found and was wondering how I can make it work on files and folders within others folders. At the moment it only effects the top level folder and not what is contained within it.
I'm am moving files onto a windows/unix server and the files will not currently copy because of the illegal characters.
Would really appreciate the help
Thanks
D
Here is the applescript code:
Code:
on run
choose file with multiple selections allowed without invisibles
open result
end run
on open droppedItems
set illegalCharacters to {",", "/", ":", "<", ">", "^", "*", "[", "]", "=", "+", ";"} -- Whatever you want to eliminate.
set replaceWith to "_"
set ASTID to AppleScript's text item delimiters
launch application "Finder"
repeat with thisItem in droppedItems
try
set newName to name of (info for thisItem without size)
repeat with thisChar in illegalCharacters
set AppleScript's text item delimiters to {thisChar}
set newName to text items of newName
set AppleScript's text item delimiters to {replaceWith}
set newName to newName as Unicode text
end repeat
tell application "Finder" to set name of thisItem to newName
on error errorMsg number errorNum
set AppleScript's text item delimiters to ASTID
display dialog "Error " & errorNum & ":" & return & return & errorMsg buttons {"Cancel", "Skip File"} default button 1 with icon caution
end try
end repeat
set AppleScript's text item delimiters to ASTID
end open