Page 1 of 1

Trash Duplicate file During Apple Photos Import

PostPosted: Wed Sep 06, 2017 11:58 am
by sourcecodemage
I recently needed a to use a photo on my computer that I had taken on my iPhone. It was in the iPhone Photos app but had not synced in iCloud yet, so I can not access it from there on my iMac.

I used Airdrop to quickly move the photo to my iMac. This worked but it put the copy of the file into the Downloads folder that Hazel watches for new photos and import them into the Photos app.

The results was that every time Hazel ran, it attempted to import the file into Photos , and the photo was rejected as a duplicate file. There must have been dozens or even hundred of duplicate file prompts from Photo app when I logged into my computer the next day.

I have "trash duplicate files" checked in Hazel, and the rule itself moves the into trash after it has been imported into Photos. However, the file stayed in the watched folder, which caused the "infinite loop" of duplicate file messages.

I checked Photos settings and there isnt' a default action that I can set for handling duplicate files. So I'll try to solve it in Hazel.

Has anyone solved this? I searched these forums and Google for an answer and did not find one.

Re: Trash Duplicate file During Apple Photos Import

PostPosted: Thu Sep 07, 2017 10:31 am
by Mr_Noodle
Not sure how you have the rule set up but try adding "Date added is after date last matched" so that it only happens when the file is added.

Re: Trash Duplicate file During Apple Photos Import

PostPosted: Thu Oct 12, 2017 10:30 am
by sourcecodemage
Mr_Noodle wrote:Not sure how you have the rule set up but try adding "Date added is after date last matched" so that it only happens when the file is added.

there are multiple ways the same photo can be added to my Photos library, it may be added by computer A but also gets into a watched folder on computer B

computer A imports it
the computer B’s hazel sees it and tries to import it
the import fails

what i would like to happen is for Hazel to take an action on failure . for example, the action could be to move the file into a “failed import “ folder that i can review at my leisure.

Re: Trash Duplicate file During Apple Photos Import

PostPosted: Thu Oct 12, 2017 11:07 am
by Mr_Noodle
No way to do that now as Hazel always does re-tries until it succeeds. You'll need to write a script to try and import yourself and do something else on failure.

Re: Trash Duplicate file During Apple Photos Import

PostPosted: Sat Oct 21, 2017 11:15 pm
by sourcecodemage
Mr_Noodle wrote:No way to do that now as Hazel always does re-tries until it succeeds. You'll need to write a script to try and import yourself and do something else on failure.

Thanks, I'll change my workflow to try and prevent this. I have a number of file types that I want imported automatically, but there can be more than one way in.
For example , Hazel manages my downloads folder, but I discovered that Apple Airdrop delivers files there are well.

So if I take a picture on my iPhone, and I want to use before it Photos syncs it with iCloud.
I might use Airdrop to "drop" the photo onto my iMac to use immediately.
In the meantime, the Photos syncs with iCloud and the photo is there.
Then Hazel sees the Airdropped photo and tries to import it.
It does this forever until someone takes action to stop it.