diff --git a/base/cocoa/ResultWindow.m b/base/cocoa/ResultWindow.m index 1c5e9a96..46e4298a 100644 --- a/base/cocoa/ResultWindow.m +++ b/base/cocoa/ResultWindow.m @@ -403,7 +403,11 @@ http://www.hardcoded.net/licenses/hs_license if ([lastAction isEqualTo:jobDelete]) { if (r > 0) - [Dialogs showMessage:[NSString stringWithFormat:@"%d file(s) couldn't be sent to Trash. They were kept in the results, and still are marked.",r]]; + { + NSString *msg = @"%d file(s) couldn't be sent to Trash. They were kept in the results, "\ + "and still are marked. See the F.A.Q. section in the help file for details."; + [Dialogs showMessage:[NSString stringWithFormat:msg,r]]; + } else [Dialogs showMessage:@"All marked files were sucessfully sent to Trash."]; } diff --git a/pe/help/templates/faq.mako b/pe/help/templates/faq.mako index 1c4e998f..29dc383f 100644 --- a/pe/help/templates/faq.mako +++ b/pe/help/templates/faq.mako @@ -61,4 +61,14 @@ Enable the [Power Marker](power_marker.htm) mode and click on the Directory colu * **Windows**: Click on **Actions --> Apply Filter**, then type "copy", then click OK. * **Mac OS X**: Type "copy" in the "Filter" field in the toolbar. * Click on **Mark --> Mark All**. + +### I tried to send my duplicates to Trash, but dupeGuru is telling me it can't do it. Why? What can I do? + +Most of the time, the reason why dupeGuru can't send files to Trash is because of file permissions. You need *write* permissions on files you want to send to Trash. If you're not familiar with the command line, you can use utilities such as [BatChmod](http://macchampion.com/arbysoft/BatchMod) to fix your permissions. + +If dupeGuru still gives you troubles after fixing your permissions, there have been some cases where using "Move Marked to..." as a workaround did the trick. So instead of sending your files to Trash, you send them to a temporary folder with the "Move Marked to..." action, and then you delete that temporary folder manually. + +If you're trying to delete *iPhoto* pictures, then the reason for the failure is different. The deletion fails because dupeGuru can't communicate with iPhoto. Be aware that for the deletion to work correctly, you're not supposed to play around iPhoto while dupeGuru is working. Also, sometimes, the Applescript system doesn't seem to know where to find iPhoto to launch it. It might help in these cases to launch iPhoto *before* you send your duplicates to Trash. + +If all of this fail, [contact HS support](http://www.hardcoded.net/support), we'll figure it out. \ No newline at end of file diff --git a/pe/py/app_cocoa.py b/pe/py/app_cocoa.py index a9a56ebb..4b3303e8 100644 --- a/pe/py/app_cocoa.py +++ b/pe/py/app_cocoa.py @@ -14,7 +14,7 @@ import re from Foundation import * from AppKit import * -from appscript import app, k +from appscript import app, k, CommandError from hsutil import io from hsutil.str import get_file_ext @@ -142,12 +142,18 @@ class DupeGuruPE(app_cocoa.DupeGuru): self.path2iphoto = {} if any(isinstance(dupe, IPhoto) for dupe in marked): j = j.start_subjob([6, 4], "Probing iPhoto. Don\'t touch it during the operation!") - a = app('iPhoto') - a.activate(timeout=0) - a.select(a.photo_library_album(timeout=0), timeout=0) - photos = as_fetch(a.photo_library_album().photos, k.item) - for photo in j.iter_with_progress(photos): - self.path2iphoto[unicode(photo.image_path(timeout=0))] = photo + try: + a = app('iPhoto') + a.activate(timeout=0) + a.select(a.photo_library_album(timeout=0), timeout=0) + photos = as_fetch(a.photo_library_album().photos, k.item) + for photo in j.iter_with_progress(photos): + try: + self.path2iphoto[unicode(photo.image_path(timeout=0))] = photo + except CommandError: + pass + except (CommandError, RuntimeError): + pass j.start_job(self.results.mark_count, "Sending dupes to the Trash") self.last_op_error_count = self.results.perform_on_marked(op, True) del self.path2iphoto @@ -156,11 +162,15 @@ class DupeGuruPE(app_cocoa.DupeGuru): if isinstance(dupe, IPhoto): if unicode(dupe.path) in self.path2iphoto: photo = self.path2iphoto[unicode(dupe.path)] - a = app('iPhoto') - a.remove(photo, timeout=0) - return True + try: + a = app('iPhoto') + a.remove(photo, timeout=0) + return True + except (CommandError, RuntimeError): + return False else: - logging.warning("Could not find photo {0} in iPhoto Library", unicode(dupe.path)) + logging.warning(u"Could not find photo %s in iPhoto Library", unicode(dupe.path)) + return False else: return app_cocoa.DupeGuru._do_delete_dupe(self, dupe)