I apologize if this has already been answered but my search of DTPO forums and KM forums hasn’t yielded an answer. I am moving all of my professional files to DTPO from Dropbox to take advantage of DTPO’s awesome features (the amazing work you guys have done with the ios app now makes this feasible for me). I presently use keyboard maestro to move files and folders to Dropbox folders with a simple shortcut. Is there a way to replicate this workflow with DTPO and KM. I want to be able to select a certain folder on my desktop, hit a keyboard shortcut and have the folder whisked away to a specific group on DTPO. Also, if anyone has any guides or tips for using KM with DTPO, it would be much appreciated.
Edit: I also use Hazel if that would help set up this workflow.
Thanks for response. As an attorney, I file motions constantly. I save them in one single folder on Dropbox. I do whatever work is necessary, save items in a new folder and hit ⌃⌥⌘M and they goto the Motions folder or I hit a different shortcut and the goto a Hazel-monitored folder where they sit for a week (easy access if I need to make changes) before being whisked off. I’ve got a couple more shortcuts that mimic that behavior. I’d like to hit a shortcut, have the item goto in Motions group in DTPO and then moved to trash!
is there a reason you put the files on Dropbox instead of a folder or folders on you computer? I do that and then index to DTPO. I use Hazel to watch a folder that receives scanned files, and it parses searched text to decide which folder on my Mac to move each file to after renaming the file. Since the final location folders are indexed, I can then go to DTPO where I find the files.
I also have another database that indexes from Dropbox folders. You could do that without changing your workflow. It’s all based on indexing instead of importing to DTPO.
I use Hazel with indexed folders myself, which is a better fit for me than trying to create something with Keyboard Maestro (which I do have a use extensively).
If a moderator can move this discussion from the DEVONthink to Go forum to the general DEVONthink macOS forum, you may get more suggestions on how to possibly set this up. The Keyboard Maestro forum may also be a good resource if that is your tool of choice.
I keep a vast majority of my documents in Dropbox on my computer. Selective folder sync makes it extremely useful since I can easily control what stays on laptop. So far, it has been one of the simplest ways to keep everything immediately backed up and available on all of my devices. I encounter friction when I have to make a decision on whether to shoot a file over to Dropbox or send to Devonthink (or both). This one reason I want to move everything to DTPO. I am very familiar with indexing, but I am wanting to be able to have access to everything on iPhone and iPad. Indexing is great with desktop but, of course, I have issues when on the go. Also, I have a relatively small amount of data, 8 gigs over a few databases, so its no issue to simply have all on my mobile devices.
So I have been researching this issue and discovered this script, originally designed to work with Hazel and to remove file extension. I have been tinkering with it and while it appears that the bottom portion will accomplish what I want but I don’t know enough about Applescript to adapt. It appears that I am having issues defining what I file I want to be moved. If I can get the script correct, I should be able to tie it to a KM shortcut and I’m golden!
Any tips would be appreciated.
tell application "Finder"
set _path to (the POSIX path of theFile as string)
set {_name, _extension} to {name, name extension} of theFile
end tell
tell application "System Events"
if not (exists process "DEVONthink Pro Office") then
tell application id "com.devon-technologies.thinkpro2" to activate
end if
end tell
tell application id "com.devon-technologies.thinkpro2"
set theGroup to get record with uuid "BCDBD151-A476-4E13-937C-ACF33337E623"
set theImport to import _path name _name to theGroup
end tell
Here’s a simple example (written in KM 8.x) working on a selection in the Finder…
tell application "Finder"
if selection ≠ {} then
set fileList to {}
set sel to (selection as alias list)
repeat with thisFile in sel
copy POSIX path of thisFile to end of fileList
end repeat
else
display alert "Nothing selected in the Finder"
return
end if
end tell
tell application id "DNtp"
set dest to get record with uuid "3D138B69-7FB3-48FB-B847-413FB0521417"
repeat with currentFile in fileList
set newRecord to import currentFile to dest
log message (name of newrecord) & " imported to " & (name of dest)
end repeat
end tell
It imports to a specific location and logs a message about the file(s) imported. This is not heavily error-trapped, it does not delete the files from the Finder after import, nor will it check if you’ve already imported the file(s).
I am a complete AppleScript noob. I can cut, paste and run Applescripts but actually writing them has always been (and still is) beyond me.
I used the AppleScript Bluefrog provided, and of course, not realizing that KM had the option to show results of AppleScript in various ways (ignore, large window, brief etc.), was getting frustrated because it kept popping up a large window that said “true”.
I then thought that the script didn’t work and set out to fix it myself (lol, I know), since I didn’t want to admit defeat so easily on a forum. I researched, tried and failed many times and finally found macosxautomation.com and its amazing AppleScript tutorial. Armed with a bunch of fresh ideas, I started tinkering again today and realized that I simply needed to adjust the KM option that shows results of Applescripts. I realized this after seeing about 20 versions of my test folder in DTPO.
As for deleting the file after I import, I was able to use a KM action to move the item to the trash from finder. While outside of the AppleScript, it does the job.
I am back up and running at full speed so thanks! I also am enjoying learning about AppleScript and testing things out. I had no idea about how AppleScript worked and the potential for automation until now! Thanks again for the help. Now back to tutorial…
I’m trying to edit this script to get it to work within DTPO but I’m having issues. I usually have the items in the inbox of a Database then move them to 1 of 3 groups. I am hoping to create a script to move an item from within the same database to a group, this way I can use Keyboard Maestro to move the record to a specific group. I’ve searched the Forums, but no one has posted a script that will work like this from what I’ve seen.
I also tried the Move script in the examples, but that has to have the Group selected in Group selector panel.
try
tell application id "DNtp"
set theDatabase to current database
set theSelection to selection
if theSelection is {} then error "Please select something"
set fromPath to (the location of item 1 of theSelection) & (the name of item 1 of theSelection)
set fromDatabase to the name of theDatabase
set theDestination to get record with uuid "5292B29B-171D-4901-A020-13B214D9B660"
if theDestination is {} then error "We had a problem choosing the destination"
set toPath to (the location of theDestination) & (the name of theDestination)
set toDatabase to the name of the database of theDestination
repeat with thisItem in theSelection
move record thisItem to theDestination
end repeat
-- Post the result to the Log
set movedFrom to "Moved from: " & fromPath & " in " & fromDatabase
set movedTo to " -- Moved to: " & toPath & " in " & toDatabase
set theLogEvent to log message (movedFrom & movedTo) info "Mover Script"
end tell
on error error_message number error_number
if the error_number is not -128 then display alert "DEVONthink Pro" message error_message as warning
end try
Which is from the Move with Keyboard script, but changed from the select to the UUID of the Group I want the destination to be.
Neither the reference URL (Copy Item Link) or the UUID is listed in the Get Info pane. This is a property only accessible by AppleScript or the context menu > Copy Item Link.