More files and subfolders
More files and subfolders
- Subject: More files and subfolders
- From: "T.J. Mahaffey" <email@hidden>
- Date: Mon, 14 May 2001 10:23:25 -0500
Ok, thanks to Mr. Briggs, this script works on the files in the root of the
folder, but it still doesn't act on the files in the subfolders. I've pored
over the code and looked at other scripts acting on subfolders. As far as I
can tell, this script should work on files of subfolders. But it doesn't.
What am I doing wrong?
on open theFolders
if checkSysVers() then
repeat with theFolder in theFolders
changeLabels(theFolder)
end repeat
end if
end open
on checkSysVers()
tell application "Finder"
if (computer "sysv") < 2144 then
beep
tell me to display dialog ,
"LabelWizard: Revised requires Mac OS 8.6 or later." buttons
{"Quit"} default button 1 with icon 0
return false
else
return true
end if
end tell
end checkSysVers
on changeLabels(theFolder)
tell application "Finder"
activate
set theseFolderItems to every item in theFolder
repeat with thisItem in theseFolderItems
set oldName to (name of thisItem)
set theOffset to (offset of "." in oldName)
set newName to (text 1 through (theOffset - 1)) of oldName
set name of thisItem to newName
end repeat
end tell
end changeLabels