Add selected file to Inbox and delete it (Alfred/Applescrip)

Hi! I’ve used the search but didn’t quite find what I was looking for, so I’ll have to create a new topic.

I’d like to be able to add Files to DEVONThink Pro from Alfred as a file action: Select a file in Finder or Alfred, use Alfred to action on the file, add it to my Databases inbox (not the global one) and delete the file in finder.

If anyone could point me to an applescript that takes the selected file and imports it into DT and afterwards deletes the original that would be great!

If there already is a worklflow like the one I’m describing I would be glad if someone could point me in the right direction.

Thanks!

I mangaged to write a workflow, here it is!

The Applescript part has to be changed to reflect the database you want to use.

Here is the Applescript (q is the file that is passed from Alfred):


tell application "DEVONthink Pro"
	set theGroup to incoming group of database named "Karl"
	import q to theGroup
end tell
set posixFile to POSIX file q
tell application "Finder"
	move posixFile to trash
end tell

Add to DEVONThink.alfredworkflow.zip (330 KB)

Well done. I hope you feel the great sense of accomplishment from making your computer do something it couldn’t do before. And I hope it encourages you to keep exploring what else you could make it do. :smiley: