Re: Convert slashes in filenames within subfolders
Re: Convert slashes in filenames within subfolders
- Subject: Re: Convert slashes in filenames within subfolders
- From: John Delacour <email@hidden>
- Date: Fri, 14 Mar 2003 14:54:36 +0000
- Mac-eudora-version: 6.0a11
At 6:08 am -0800 14/3/03, B2 Fass-Holmes wrote:
Can anyone please point me to a preexisting script that can change
filenames and foldernames containing slashes (replace slashes with
dashes or whatever) within all of the folders within a selected
folder?
I have other users' folders containing over 1,100 such files and
need to mass-convert them (doing it manually would take hours).
The fastest way os probably to use Tanaka's osax to get two lists:
as {full pathname of files in all contained folders, new names}
and then to loop through the list in the finder
set chr to "a"
set dir to path to "docs" -- the folder to search within
set pathnames to MT List Files dir name contains chr return as string
with sub folders
set namelist to {}
set my text item delimiters to ":"
repeat with f in pathnames
set fname to last text item of f
set newname to MT Replace fname search chr replace "*"
set end of namelist to newname
end repeat
namelist
tell application "Finder"
repeat with i from 1 to count pathnames
set f to item i of pathnames
set n to item i of newnames
set name of file f to n
end repeat
end tell
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.