A Moderately Useful DevonThink Import Macro

km8

#1

I've had to clean up huge swathes of files by importing them in various DevonThink Pro Office databases and groups. Because I didn't want to import first in the Inbox and then refile, I've made a macro to import directly into a given group.
Because I have too many groups to remember, I've added a "spotlight" style search that allows me to whittle down the groups as I type.

  1. Importing to the global inbox:
    • type the keybinding ⌃⌥⌘I
    • your file disappears into DevonThink's Global Inbox
    • NOTE: you need to put the UUID of your own Global Inbox in the macro, of course (thx @rolian !)
  2. Importing to a specific database:
  3. Importing to a specific group in a database:
    • type ⌃⌥⌘G
    • a window appears with a list of the groups in your open databases. Start typing in the text field to narrow it down, select with arrow keys / return or the mouse.
    • The nifty thing is that it will allow you to start typing the database name and only show you the relevant groups for arrow / mouse selection.

This macro relies on the Spotlight Search Prompt macro, which you'll need to install in your KM library. It's a great plug-and-play way to give a large number of options to the user.

As for my macro, it's crude, but hey, it works! Pointers and constructive criticism welcome!

Apps DevonThink Import files from Finder Macros.kmmacros (20.1 KB)


How to rewrite DevonThink import file macro for Pathfinder
#2

Hi @seishonagon, many thanks for sharing the macro :+1: I will try it out later.

So far I have always sorted my Finder file in DEVONthink this way:


#3

This is terrific. Thanks for sharing. Only thing I'd add is that you should insert a comment into the Global Inbox macro telling people to change the UUID to the one specific to their Global Inbox. Otherwise, while it still puts the file there, it doesn't delete it from the Finder.


#4

Hi, please could you explain or share how you do that? Thank you in advance. Jeando


#5

Hi @profjeandoKeybordM, You have 2 possibilities to call the DEVONthink selection window.

You can either work with a shortcut, like here:

But you can also use the action "Select or show a Menu item":


#6

Hi Appleianer,

So simple! Thank you!

All the best,

Jeando Masoero

initial Alexander technique teacher

Logo_iat_130px.png


#7

Thank you @profjeandoKeybordM :+1:
I also found this rather accidentally, because it is hidden in Services - Settings - Shortcuts under "Pictures" and not under the menu for "Files And Folders".


#8

This macro is now definitely more than moderately useful. If you take the json output from the Groups macro and run it through a json->csv converter e.g. http://convertcsv.com/json-to-csv.htm ), you get a nicely formatted Excel spreadsheet) with the UUID of every group in your databases. This is enormously helpful for Applescripting and Hazel rules on a Mac and for creating scripts in the Shortcuts app on iOS- there's no need to go into DEVONthink and get the UUIDs one by one. What a timesaver!! Thanks again. for this great macro set.


#9

Happy you like it !


#10

totally awesome!
Whats the easiest way to deduce the uuid of the global inboxw/o scripting?

TIA
r.


#11

more than mildly interested: how do you exactly capture the output from the groups macro?

TIA
r.


#12

In the "Import to DT Groups" macro, after the second action (or first action after the initial comment) if you want to be precise), which runs the AppleScript and saves the json info to the variable "jsonListGroups", just insert another action to display that variable in a window. (Or, just duplicate the Execute AppleScript action, but change the dupe to "display results in a window" instead of "save results to variable").
Copy the text from the window and run it through a json-->csv converter.

Either way, you'll get the UUIDs nicely formatted for all the top level groups in your open databases,

file:///.file/id=6571367.7750419


#13

If you use the converter I linked to above, the output will look like this:


#14

Bingo!

Worked like a charm :wink:

Thanks and happy weekend!
r.