tell application "Preview"
quit
end tell
tell application "Finder"
empty trash
end tell
This simple AppleScript does the work, and with the free application Spark, it's only a keypress away from activation.
|
|
|
After opening a file with Preview, the app blocks it (marks it as in use) until you quit Preview. To easily empty the trash without manually switching back to Preview and closing everything, I found finally this (simple) solution. Open Script Editor and create this AppleScript:
This simple AppleScript does the work, and with the free application Spark, it's only a keypress away from activation.
•
[8,788 views]
Hint Options
Empty trash without Preview blocking a file
This problem also affects QuickTime Player and is down to a bug. I reported this bug to Apple back in the Mac OS X 10.4.x era and they confirmed its existence but certainly as of 10.4.11 with the latest QuickTime etc. it still occurs.
Silliness
I can't actually duplicate the conditions under which this is necessary. I opened a file in Preview, closed it without quitting preview, dragged it to the Trash, and then emptied the Trash. No problem. It complained when the file was still actually open in Preview, but that is hardly surprising (I'd be surprised if it didn't complain), and is by no means restricted to Preview. Even if this was an issue with Preview, I fail to see why this is particularly helpful. I wouldn't want to quit Preview every time I emptied the Trash on the off chance that it might still be hanging on to a file. Even if it is, everything else will still be deleted and if there is some urgency to deleting the one troublesome file, it is not exactly taxing to quit Preview. But like I said, I can't duplicate the problem. This hint would be better if rather than the pretty silly "solution" it just said: "If you can't delete a file that was recently open in Preview, try quitting Preview, it might still be holding a reference to it."
Does this also affect ejecting volumes?
often a volume will refuse to eject even though no files are obviously open. Many hints here on that, but it would be useful to know if Preview is a common culprit.
Not really a solution
I tested this too and it did not happen for me either. I do remember that it did sometimes happen in the past, but this applescript does not really solve the problem. If only shortens the number of mouse clicks you make to do the same thing, namely quitting Preview and then emptying the Trash. A real solution would make that Preview does not have to be quit to empty the trash.
Empty trash without Preview blocking a file
This was a lot bigger problem back in the classic Mac OS days, basically applicable to any application and any file it had opened.
Empty trash without Preview blocking a file
I select "empty secure trash" in the finder menu, and all blocked files are trashed out, even the movies playing in Quicktime....
I wrote exactly the same script and run it with Spark
A long time ago I faced the same problem over and over again and came to the same solution. Just insert the script in the freeware Spark and emtying the trash is just pressing a button (I use F12 and set it to "-" in the system preferences).
Empty trash without Preview blocking a file
Thanks for the hint but I don't think quitting the whole app is the solution when most of the time I have many documents open in Preview.
Empty trash without Preview blocking a file
So my question is, why do some people experience this issue, but others don't? If it were truly a bug, it would be reproducible pretty much universally...
Empty trash without Preview blocking a file
If it were truly a bug, it would be reproducible pretty much universally...
Wha? I disagree.
Empty trash without Preview blocking a file
If a significant percentage of people don't experience the issue, then it becomes much more likely that the problem is caused by some unique set of circomstances on a given machine, rather than a OS-specific bug. It would also make it quite likely that Apple can't reproduce it (consistently anyway) in their testing environment, which explain why no "fix" has been forthcoming...
Empty trash without Preview blocking a file
I originally reported this (bug) to Apple with regards to QuickTime Player as Radar number 5544934 in October 2007.
Empty trash without Preview blocking a file
How does this help if Preview isn't the app that's preventing a file from being opened? You'd have to write a similar script for every app that does this, then remember which apps have been launched with the troublesome files and then remember how to launch those scripts. Man, the community must be hurtin' for hints if this is what it's come down to. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.23 seconds |
|