Re: Problem Emptying Trash
Re: Problem Emptying Trash
- Subject: Re: Problem Emptying Trash
- From: "J. Stewart" <email@hidden>
- Date: Sun, 5 Mar 2006 10:19:31 -0500
On 3/4/06 at -0500 Jon Rosen said this
>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.
This will clean out pdf files, use with care as there's no way to easily undo it. You can replace (choose folder) with an alias to your folder for non-interactive usage.
set dFold to (choose folder)
tell application "System Events"
delete ((every file of dFold) whose type identifier is "com.adobe.pdf")
end tell
JBS
--
Any government big enough to do things for you is big enough to do things to you.
_______________________________________________
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