Page 1 of 1

Unintentionally creating duplicates in Devonthink

PostPosted: Fri Sep 13, 2013 9:49 am
by cyberskier
I'm using Hazel in conjunction with Devonthink, to import files into specific Devonthink groups via an Automator action that comes packaged with Devonthink. I'm frequently seeing some strange behavior, where the file is correctly moved into Devonthink, but then a second copy of the file is also moved into Devonthink, along with its initial folder structure (so if the file is in a Hazel-monitored folder called "Action," then the entire Action folder is also moved into Devonthink. Even stranger, on several occassions, I've even had my entire Desktop folder (not monitored by Hazel) moved into Devonthink, after I drag one file from the desktop into my Hazel-monitored "Action" folder.)

I thought this might be an Automator issue, but I removed Hazel from the equation (by selecting the file outside of a Hazel-monitored folder, and manually running the Automator action), and things work fine.

Here is my Hazel recipe:

Image


And this is the Automator action:

Image


Any insight into this would be greatly appreciated.

Thanks,
Evan

Re: Unintentionally creating duplicates in Devonthink

PostPosted: Sun Sep 15, 2013 9:50 pm
by sjk
Noticed your related DEVONtechnologies User Forum topic:

Duplicate Automator/Hazel import

Re: Unintentionally creating duplicates in Devonthink

PostPosted: Mon Sep 16, 2013 6:35 am
by Skeo
My immediate thought here would be the first item in your workflow. Which is get selected items.
That function "gets" whatever is currently selected in the finder.
So when hazel runs, it is actioning the workflow, which is then "getting" whatever you currently have highlighted in the finder.

It looks to me with the rules you have, that hazel is not feeding the file into the workflow. It is simply telling the workflow to run and then automator is grabbing files on its own.

I wouldn't be confident telling you an answer without playing around with it, but my first guess would be to save the workflow as an application in automator, change hazel to open the file with that application instead of just running the workflow, and then you might have to edit the workflow a bit to accept input files. Or maybe not.

good luck!

Re: Unintentionally creating duplicates in Devonthink

PostPosted: Mon Sep 16, 2013 11:29 am
by cyberskier
Awesome, Skeo! I think you hit the nail on the head, or so it seems in my limited testing. I'll have to test out if converting the Automator workflow to an application is enough to fix this. If not, I don't know enough about Automator to tweak things.

Re: Unintentionally creating duplicates in Devonthink

PostPosted: Tue Sep 17, 2013 12:51 pm
by Mr_Noodle
Yes, make sure any Automator workflow you use with Hazel takes files as input as Hazel will pass it in.