Can I preconfiguring the Capture Clipboard with specific tag/s?

,

I would like to know if this possible since I couldn’t figure it out.

I would like to preconfigure the capture clipboard to always be populated with two tags. In my case they would be: send to anki and neurology

Of course as I study I would change the latter term and so forth but prepopulating these two field would be make capturing things in the clipboard a bit quicker since I don’t have to worry about populating the two tags thus saving 3 physical input commands.

    1. to populate the first tag
    1. after the tag is placed the cursor automatically jumps to the body of the capture field so I have to go back and click tags
    1. typing the second tags

So in my specific user case its a bit inefficient and I would like to be customize this process a bit if the app permits this but I don’t really know.

I already have a workspace setup to get all the notes created with those two tags and it helps me a lot.

thanks in advance.

I don’t believe there are any settings for that.

Assuming only the built in automation tools one the Mac, here’s how I would approach this.

If you are running Monterey, a Shortcut given a shortcut (via adding it as a service-based Quick Action) will give you something that can do this.

If you are pre-Monterey, you could do something similar using an Automator workflow for the Quick Action, and using the Drafts URL Scheme instead.

2021-10-31-19.30.31

In both cases I’ve used arbitrary tags “foo” and “bar”, with the body of the new draft being the current content of the clipboard. Note you can specify the keyboard shortcut via your keyboard preferences.

Hope that helps.

Wow, thanks so much !! I’m running Drafts on the Mac mini M1 with Big Sur so I’ll try the first option I think. I’ll let you know how it goes. Gotta love Drafts, doesn’t my request seem sort of logical though as a new feature perhaps. Of course I’m strictly thinking as a non programming kind of a person.

cheers,
J

I would say it sounds more like a custom clipboard capture, most people wanting to process a potential variety of drafts in Drafts than a consistent additional tagging for a period of time.

Fortunately, Drafts gives ways to do the automation too :wink:

Thanks to be honest I’m kind off stuck with the creation of the services.

so I got upto here but I can’t figure out the 1st part. Any tips?

Got it, thank !! I figured the 1st part.

So I can get this run but nothing happing in the capture clipboard nor anything is created in Drafts the app. Any ideas, thanks

You have created something different to what I showed you above.

  1. I can’t remember the exact details, but it looks like you have set it to only be available in Drafts rather than any application.
  2. You have specified it as rich text rather than plain… Though that ultimately would not matter as we are not using Automator to get the clipboard…
  3. You have added an unnecessary Automator step to get the clipboard.
  4. Previously you had the double quotes around the URL, but then you have removed them. This shouldn’t matter as lond as any tags with spaces get URL encoded, so just noting the change.

I did test mine (on Monterey) before posting. It did seem to work as expected - all the work is being done by Drafts. Automator is just putting the trigger in a form we can add a keyboard shortcut to.

You have two options here, per the original request, with URLs. As @sylumer suggested, you can use the below to “Create” the draft.

drafts://create?text=||clipboard||&tag=neurology,anki

If you want the actual “capture” window as you originally asked, you can also use the below, which will open the capture modal with the information prefilled so you can approve/modify it before the draft is actually created, if that is desireable:

drafts://capture?text=||clipboard||&tag=neurology,anki

Those are complete, you can paste those URLs in Safari to test, and a single step Automator action that opens that URL should work.

Sweet, very appreciated. I can’t wait to try it this afternoon.

So I was able to customize it like so: drafts://capture?text=||clipboard||&tag=neurology,send%20to%20anki and when I place it in Safari it works like a charm but the setup of the automator is not working for me. Is there an app that does something similar I can buy to run this x-call back url that is easier for us non programming dudes to figure out. I feel like a dweeb just asking but I couldn’t figure out the automator part when the script works so nicely.

Thanks
J

I think you might struggle to find anything easier than Automator. They all tend to be more advanced tools for when you outgrow Automator.

I’ll try and get some time later this evening (already evening here in the UK) to share a prepopulated Automator file for you to try.

Wow, thank you so much, I so so so so appreciated.

here’s the snippet

drafts://capture?text=||clipboard||&tag=neurology,send%20to%20anki

Thanks so much, again I can’t thank you enough !!!

1 Like

I’ve uploaded the Automator file for Droplr, prepopulated with your URL above.

When you download it, you should see a workflow file called “Custom Drafts Clipboard Capture.workflow”.

While I am obviously a trustworthy soul, I am just some guy on the Internet. Downloading and running files without a bit of due diligence is not advised. That’s one of the reasons I posted the details rather than a file. The file tends to hide what it is going to happen, and for all you know, it could be malicious.

Before running this action, I would recommend you do open it in Automator, just to confirm that it is doing nothing untoward. If you should be unsure, do not run it, but I would like to start you off with some good practice around this.

To open the file in Automator, right click on the file, select “Open With”, then select “Automator.app” => NOT the one that mentions the installer at the top, but the one underneath that.

2021-11-01-19.34.52

If you were happy with how it looked in Automator, install it by double clicking on it and choosing “Install”.

2021-11-01-19.16.24

Installing it will move the file to the Library/Services folder in your home folder. It might open the “Extensions” preferences for you (it did for me). You don’t need to worry about that, but if it does, you may as well keep it open as you will need the system preferences in a moment.

If you want to see the workflow file in your services folder, you will find the Library folder is hidden by default in Finder. If you open Finder, go. to the “Go” menu, then hold down the “Option” key, you will see the option to go to the Library folder appear. You can navigate from there to check that the file is in place if you wish. If you want to edit the URL at a later date, to change the tags, that’s the file you will want to edit in Automator.

In the preferences, if you navigate up one level from “Extensions”, or just open it if it didn’t open before, and then navigate to “Keyboard”, you will see a tab called “Shortcuts”. Select that tab and then “Services” in the list on the left. On the right list, navigate down to the “General” section - you are looking for “Custom Drafts Clipboard Capture”. Here it is in my system:

When you select it you can see a pill shaped button appears on it to add a shortcut.

2021-11-01-19.24.55

Click the button, hold down the keyboard shortcut you want to use to trigger it, and you should then see it change in the settings.

2021-11-01-19.25.59

Now when you press that keyboard shortcut, it will trigger the service, which is an Automator Quick Action workflow, which will open the URL specified in the workflow, and let Drafts do its magic.

As a recap, the key steps are:

  1. Download the Automator file.
  2. Check the file is not malicious.
  3. Install the Automator file.
  4. Set the keyboard shortcut for the service in the Keyboards > Services settings.

Hopefully, that will be enough to get you going with no additional spend.

Wow what an explanation. Thanks so much !! Yes I definitely think I can follow along. I’ll be home in 3 hrs and will test as soon I arrive. Triple quadruple thinks !!! Cheers

J

Ok so let me recap, what I did, I followed your instructions to the tee and this is what I get. I did the recap.

Installed by double clicking

Then I pressed the shortcut and I get this

image

Its where you said it would be

From the above screenshot I double click it and get this

I run it from here and get the same as above

and that’s where I stopped. Again triple thanks

That error message indicates it is prefixing what is presumably your home directory path to the URL. I’m struggling to see how, given the URL is pretty darn explicit and does not include or invite any insertion of the home path.

Could you try changing the shell drop down from /bin/zsh to /bin/bash for the workflow and run it from inside Automator to see if you get the same result?

I’m wondering if maybe there’s an issue there in your availability of the Z shell. :man_shrugging:t2:

Thanks again, I did as you suggested but I keep getting the same error.

I also tried all the shell but when I got perl

so I launched it via the service shortcut but nothing happens but If I paste the url in safari it works like a charm.

Again, thanks for all your input, hopefully Drafts support can chime in and elucidate this mystery.

Thank you

I’m going to update to Monterray to see if that helps and try maybe using the Shortcuts solution.