Indexed Folders

In DT2 I had a group of folders I used to store receipts (business, personal…). To do so I had a folder on my Mac for each and Hazel would run an Applescript to put files that showed up in those folders in the proper DT2 Database. I have been trying Indexed Folders and Smart Rules in DT3, but when Hazel cleans up the folder on my Mac, the file disappears in DT3. I’m guessing this is expected behavior, but it doesn’t work for my personal workflow.

Is there a way to use a similar Applescript for DT3? I tried editing the one for DT2, but Applescript isn’t my language.

I have no problem changing my workflow if there’s a better way, but I need separate folders to place receipts in. I can’t think of a way to sort from the global inbox based on content. I have a lot of receipts coming from a lot of different places.

Any help is greatly appreciated.

Here is the Applescript I used on DT2…

tell application id "com.devon-technologies.thinkpro2"
set img_ib to get record at "/Receipts - Personal" in database "Matt"
import theFile to img_ib
end tell

Here is what I have in DT3. I have tried “Move”, “Duplicate” and “Replicate” as well, but it doesn’t seem to make a difference.

Hi Fotan,

It seems that your Finder folder is indexed in DT3, therefore documents disappearing ince Hazel cleans the folder. A better way would be to import you documents into DT3.

To do so, you can use a folder action in Finder which imports all docs into DT3. Moreover, you could also apply a rule in DT3 or the right mouse key on the indexed folder and import your docs. Thought, the first method is applied automatically. Once imported you could use a rule within DT3 in order to move your docs in the appropriate DT3 structure.

Hope that helps

Best regards
Steffi

1 Like

but when Hazel cleans up the folder on my Mac, the file disappears in DT3. I’m guessing this is expected behavior,

Yes, that’s certainly the expected behavior. If the file isn’t in the indexed folder, it will disappear / be reported missing in DEVONthink.


tell application id “com.devon-technologies.thinkpro2”

This isn’t wrong but it is not the suggest method now. Use

tall application id "DNtp"

If you want to continue to use Hazel on your Desktop, and you are indexing the folders it moves files too, there is no need for an AppleScript. You would just index the folders into the appropriate database.

You could also index the main folder into a database and have smart rules act on the items when you drop them into the folder in the Finder.

Here’s a simple example…

And since there’s no Move into database action (or Move to External folder, which @cgrunenberg would have to assess whether to include them as actions), there is a small embedded script…

on performSmartRule(theRecords)
	tell application id "DNtp"
		repeat with theRecord in theRecords
			consolidate record theRecord
		end repeat
	end tell
end performSmartRule

This merely moves the file from the indexed folder into the database.
The next step files it in a chosen folder, though you could easily use the Move action as well.

Thanks for the try guys. Is there a way to take a PDF from an indexed folder and MOVE it to a database effectively removing it from the indexed folder? That would solve my problem using DT3’s methods. I just don’t want duplicate PDFs sitting in a finder folder and in my DT3 databases.

Just use them right mouse key and import

Umm… that’s what my smart rule does.

you could easily use the Move action as well

So, using the Move option should move the PDF, not just copy it? Then when Hazel cleans up the folder, the PDF will still be in the database?

This is what I originally tried, but it didn’t work.

So, using the Move option should move the PDF, not just copy it?

Yes, but you’re looking at the wrong thing. The code snippet I included moves the file into the database, then files it with the Move action.