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

delete files in nested folders


  • Subject: delete files in nested folders
  • From: Mike Flowers <email@hidden>
  • Date: Tue, 18 Nov 2003 12:28:12 -0500

I tried "without invisibles" and an If/then statement for files beginning in "." but got the same results.

------
On Nov 18, 2003, at 10:10, Steve Mills wrote:

>Just skip files that start with a '.'.

------
>Hi all,
>I am trying to make a script to delete files in nested folders 4 weeks after its creation date. I have >>this so far:

>set PurgeDate to (current date) - (4 * weeks)
>set fileRef to "MyMac:Cut CDs:test trash:"
>tell application "Finder"
> set bigList to list folder fileRef
> set bigListpath to {}
> repeat with eachItem in bigList
> set tempbiglistpath to fileRef & eachItem
> set atempbiglistpath to tempbiglistpath as alias
> set kindof to kind of atempbiglistpath
> if kindof is "folder" then
> set tempbiglistpath to tempbiglistpath & ":"
> set littlelist to list folder tempbiglistpath
> set littleListpath to {}
> repeat with eachlitem in littlelist
> set the littleListpath to tempbiglistpath & eachlitem
> set alittleListpath to littleListpath as alias
> set kindofl to kind of alittleListpath
> set llmod to modification date of alittleListpath
> if kindofl is not "folder" and llmod < PurgeDate then
> delete file littleListpath
> end if
> end repeat
> end if
> end repeat
> try
> empty
> end try
>end tell

>But it tells me it cant get file .DS_Store. Can someone help me with this? If anyone has a better way >to do it, let me know.
_______________________________________________
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 label from a record (part 2)
  • Next by Date: Save opend file as eps in Illustrator...
  • Previous by thread: Re: delete files in nested folders
  • Next by thread: Re:delete files in nested folders
  • Index(es):
    • Date
    • Thread