• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
More files and subfolders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: More files and subfolders
      • From: Paul Berkowitz <email@hidden>
    • Re: More files and subfolders
      • From: Bill Briggs <email@hidden>
  • Prev by Date: Re: Scientific notation to text
  • Next by Date: XML parsing for pre 8.5
  • Previous by thread: OSA Events
  • Next by thread: Re: More files and subfolders
  • Index(es):
    • Date
    • Thread