• 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: Problem Emptying Trash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem Emptying Trash


  • Subject: Re: Problem Emptying Trash
  • From: deivy petrescu <email@hidden>
  • Date: Sat, 4 Mar 2006 20:14:20 -0500


On Mar 4, 2006, at 18:46, Jon Rosen wrote:

We updated a computer from 10.3 to 10.4.5 and a script that had been running reliably for well over a year started timing out. It seems to hang up in a portion of the script that moves files in a folder one at a time to the trash and then empties the trash. That is this part of the script:

tell application "Finder"
		repeat with i from 1 to pdfCount
			--pdfFiles only contains a list of the individual PDF files
			set thisFile to (pdfFolder as text) & item i of pdfFiles as text
			delete thisFile as alias
		end repeat
		-- empty the trash so it doesn't fill up with 50,000 files
		empty
	end tell

I couldn't find a way to delete all of the files in a folder at once, but I would welcome any suggestions. Has anything changed between 10.3 and 10.4 that would affect this type of script. BTW, I opened the Trash window in the Finder and added a 1 second delay before the empty command, and that may have improved the situation for unknown reasons. For the record, this script works with FileMaker. It takes a group of PDF files created by FileMaker, combines them using the PDFtk tookit, and then deletes the individual files and moves the combined file to a new location.

TIA,

Jon


<script>
set the_folder to choose folder with prompt "Choose folder to delete files from"
tell app "Finder" to delete every file of the_folder
</script>


I would *not* empty the trash via AS. I'd probably check to make sure everything is OK. You already saved time by avoiding the loop.

It is better a bit more work than a "Ooops!"


Deivy _______________________________________________ Do not post admin requests to the list. They will be ignored. Applescript-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Problem Emptying Trash (From: Jon Rosen <email@hidden>)

  • Prev by Date: Problem Emptying Trash
  • Next by Date: Re: Problem Emptying Trash
  • Previous by thread: Problem Emptying Trash
  • Next by thread: Re: Problem Emptying Trash
  • Index(es):
    • Date
    • Thread