Quantcast
Channel: DEVONtechnologies Community - Latest posts
Viewing all articles
Browse latest Browse all 16117

Keyboard Maestro Macro to quickly copy the name of a similar file

$
0
0

Hey there,

I use DEVONthink mainly to file my documents. A really nice feature is that DEVONthink AI shows me all related files. (The lower part in the right pane named See also & classify)


In this example I need to rename file A and used the lower right pane to check that it should be renamed similar to file B.

So I wrote a macro to quickly copy the filename of file B then (optionally modify it) and then paste it to file A and make sure that the preview window will show file A again.

Without the macro to copy the name I’d have to right click the file, then click Get info “wait” for the popup to open and the text to be selected. Then copy it using Cmd+C, dismiss the popup and then select the initial file again (to see the correct date) and rename it using Enter & Cmd+V.

Over the holidays I sat down to automate these steps with Keyboard Maestro so it’s now only one keystroke to

  • get the name of the current item in the preview
  • remove the date prefix
  • reselect the initial file in the preview
  • paste the filename with the cursor where the date should go.

The macro doesn’t use any click events or similar things. It just works with menu bar items so it should be very stable but needs to be adjusted for other localizations than EN.

Please let me know if it is of any help for you or if you have suggestions :slight_smile:

Cheers Jan

Copy filename.kmmacros.zip (3.7 KB)
Notes for potential adjustments:

  • I use the file format yyyy_mm_dd .* in case you format your dates differently you need to change Assert that filename was retrieved and Remove date from filename.
  • I use a prefix of - as indicator for Hazel to assume a shorter date format and -- to find a date from the content of the file. You’d probably want to change Remove date from filename and disable Select -- Prefix.
  • I like to have the pasted filename in the clipboard history. Otherwise you can enable Delete Current System Clipboard.

Viewing all articles
Browse latest Browse all 16117

Trending Articles