• 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
Re:Delete files in nested folders
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re:Delete files in nested folders


  • Subject: Re:Delete files in nested folders
  • From: Mike Flowers <email@hidden>
  • Date: Thu, 20 Nov 2003 10:52:25 -0500

I fixed the bad line breaks but it still says it can't make some data into the expected type. I get the same results in OS 9 and 10.

On Nov 18, 2003, at 8:07 PM, Graff wrote:
>And of course it got messed up again! The proper line continuation
>characters appear to have gotten converted into the commas. The lines
>
> set theFolder to choose folder with prompt ,
>
>and
>
> set deleteList to every file of currentFolder whose ,
>
>should have an option-return at the end of them instead of ",". The
>proper character should look like a letter L with the long side on top
>and short side on the right.

>On Nov 18, 2003, at 8:07 PM, Graff wrote:

> It looks like that's due to the line wrapping in e-mails. That entire
> quoted text should be on one line, but it was too long and so the
> e-mail software split it into two lines. I have fixed it so that the
> code works by using the "," symbol to manually split the line. Here's
> the fixed code.
>
> - Ken
>
> code:
>
> --this runs if the icon is double-clicked
> on run
> set theFolder to choose folder with prompt ,
> "Choose a folder with to clean of old files."
> deleteOld(theFolder)
> end run
>
> --this runs if a file is dropped on the icon
> on open openedfolder
> set theFolder to openedfolder as alias
> deleteOld(theFolder)
> end open
>
> -- here is the main function
> on deleteOld(theFolder)
> set folderList to {}
> set purgeDate to (current date) - (4 * weeks)
> copy theFolder to the end of folderList
> repeat while length of folderList is greater than 0
> tell application "Finder"
> set currentFolder to the first item in folderList
> set folderList to the rest of folderList
> set deleteList to every file of currentFolder whose ,
> modification date is less than purgeDate
> repeat with currentItem in deleteList
> delete currentItem
> end repeat
> set newFolders to every folder of currentFolder
> set folderList to folderList & newFolders
> end tell
> end repeat
> beep
> display dialog "Done Cleaning" with icon note giving up after 2
> end deleteOld
>
> On Nov 18, 2003, at 4:01 PM, Mike Flowers wrote:
>
>> It gives me an error "can't make some data into expected type" when
>> it gets to:
>>
>> "set deleteList to every file of currentFolder whose modification
>> date is less than purgeDate"
>>
>> what's it expecting?
_______________________________________________
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.

  • Prev by Date: Re: Getting dictionary of app (was:Getting label from a record (Reasons))
  • Next by Date: Selected text in mail.app
  • Previous by thread: Re: delete files in nested folders
  • Next by thread: [ANN] November BAUG Meeting
  • Index(es):
    • Date
    • Thread