Shaky hands needs a little help with an applescript (or?) for moving a record

Hi all, I couldn’t find anything related to this (in the very specific way I intend to use it), so here it goes:

My hand shaking is getting a bit worse, and the German company that makes those amazing devices that adapt to your mouse only works with Windows machines, not Mac.

One of the issues I’m having is getting tons of stuff in my inbox, then dragging the records to the desired locations. Sometimes, these locations are (temporary) groups in the inbox itself.

Dragging is killing me, I tried altering the mouse / click accessibility settings (delay, for example), but it’s still not working well. As a result, sometimes the drag and drop “fails” before I reach the target and I am forced to cmd-z and try again.

Using the “Move to” contextual action is useful in some situations, but not much if there are many targets, and even if there is a list of favorites to move to, sometimes the target isn’t there yet, so, lots of digging.

What I thought a possible solution was - please tell me if this is crazy: click a record, hit a shortcut key to copy it’s reference, then click the target group, hit a shortcut key to move that record into it.

Anyone has any idea of how to do this - or even if there’s a more obvious, better way?

I seem to recall that many years ago there was some Mac app that did something similar, you would click to copy than click to paste. Don’t remember if it was a web builder, maybe.

Any help appreciated!

There are a number of Apple accessibility features that may help:

2 Likes

many thanks for the reference!

1 Like

Perhaps one can cobble together a workflow with Keyboard Maestro or BetterTouchTool?
Pseudo code:

  • have macro wait for click in DT
  • check if DT’s selected records property contains exactly one element which is a document (scripting)
  • if so, grab the document’s UUID (scripting)
  • display DT’s group selector (scripting)
  • if the user selects a group, move the record into it.

And here’s the code for easy copying:

const app = Application("DEVONthink");
const selection = app.selectedRecords().filter(r => !['group','smart group','feed','property list', 'unknown'].includes(r.recordType()));

if (selection.length === 1) {
	const record= selection[0];
	const targetGroup = app.displayGroupSelector(`Select target group for ${record.name()}`, {buttons: ['Cancel', 'Move'], for: app.currentDatabase})
	if (targetGroup) {
    app.move({record: record, to: targetGroup});
	}
}

The script displays groups from the current database. If you want to have groups from all open databases, remove for: app.currentDatabase from the displayGroupSelector call. Or use for: app.databases["NameOfMyDatabase"] if you always want to move to a particular database.

Also, the script filters out everything that should not be movable in the second line (groups, smart groups, etc). If there are other record types you don’t want to move, ever, add their type to this list.

3 Likes

Christian, this is great, thank you - I am going through it now.

@uimike:

All done within DEVONthink by copying the item link and pasting into the destination…

And just to show off a little more, I transfer multiple files at once…

Jim, how are you doing that? If I copy the link and paste it I get an inetloc, rather than the record.

Good question. I can’t make that work, either – getting an inetloc as well.

Since version 4.0 the Move/Replicate/Duplicate To contextual menus contain a search field too and the contextual menu can be opened via the shortcut Ctrl-Return since macOS Sequoia.

Another possibility might be Data > Move To… and its shortcut Cmd-Ctrl-M. By holding the Option or Command-Option modifier keys this panel also supports replicating and duplicating.

3 Likes

These are great Christian - and I do use them. The specific instance I am thinking of is this:

    1. I added a number of files to the inbox (say, via Firefox extension to add to DT)
    1. I take a quick look at them to categorize, and move them to temporary groups inside the inbox as well, so they are in the inbox root
    1. Later, I look at these temporary groups and move the contents to their final destinations, which can be several different databases.
    1. I could add these temporary groups as favorites, but I often delete some, add new ones, so they are not really a stable structure.
    1. What I have been doing, is looking at my inbox and say 20-30 new records, and dragging them to the respective groups - it is a simple process, but it is getting harder due to my hand shakiness.
    1. If I use Move, I then have to either find the target group in the favorites, or search, and that is a bit more involved and not as direct.

Actually, Christian - your Cmd-Ctrl-M suggestion can work well for me! I see I can add new groups easily using the “+” at the top.

Many thanks!

Glad to hear my suggestion is useful.

1 Like