Cool & useful Android shortcuts (made with MacroDroid) (and a tutorial on using URIs as intents on Android)


MacroDroid


What is MacroDroid?

MacroDroid is a powerful task automation and configuration app that focuses heavily on usability, with a simple UI and logical step by step process.

You can find it on the Play Store (for free with 5 macros, or you can buy premium).

I love it - I use it mostly to toggle phone settings and automate some notifications, but you can automate almost anything - especially with plugins and/or a rooted device. It can even read UI and simulate screen touches.


My macros with Obsidian

Here are a few shortcuts I’ve put together:


Gesture up/down on the fingerprint reader to fold/unfold headings:


This is super useful to me, I couldn’t live without it any more. I often find it very frustrating to navigate in the app.

Obviously you can’t see what I’m physically doing, (I hope), but here I’m just moving my finger on the fingerprint scanner (up to fold, down to unfold):

An idea for left/right gestures is to slide open the left and right panels, or to navigate forward and back.

Shake device to close everything and go to homepage:


Any more than one panel on Android is a nightmare.

I usually only open one accidentally in the first place, then everything is so scrunched up together, and closing panes is hidden under a bunch of button presses, and is right next to the damn delete option.

Now I can simply return to my home page by shaking my device:

Volume keys to cycle between Edit and Preview modes:


This one I don’t use nearly as often as the others above, but the volume keys seem like an obvious shortcut trigger. If anyone has a good idea for a volume button shortcut I’d love to hear it.

Here I’m just just pushing the volume buttons on my phone:


How to use MacroDroid with Obsidian


To send stuff to Obsidian, we will use the Advanced URI plugin and the ‘Send Intent’ action in MacroDroid.

What is an intent?
An Intent is a messaging object you can use to request an action from another app component.

For now we can just think of an intent as Android’s way of communicating with the Obsidian API. For example, if you go to this link, it will simply open Obsidian.

These are the most obvious shortcut device triggers I have set up to work with Obsidian:

  • Fingerprint gestures (very useful to me!)
  • Volume key presses
  • Shaking device

Sending intents from MacroDroid:


  1. On MacroDroid, the Send Intent action will give you a dialog like this: https://i.imgur.com/076Q3kT.png
    • Action will be set to: android.intent.action.VIEW
    • Data we will set this to the desired URI, for example: obsidian://open
    • You can leave everything else empty
  2. In Obsidian, run the Advanced URI plugin command ‘Copy Command URI’, then paste it into the Data field on MacroDroid
    • For a quick test, you can also set to: obsidian://open
  3. Set the macro constraints to run only when Obsidian is the app in the foreground

And it should be good to go!


A few more useful URIs like append/prepend can be obtained through the Advanced URI documentation


Anyway.

What do y’all think? Anyone need the macros? Or have any good ideas?

5 Likes

I had never heard of MacroDroid until now, so that alone is a tremendous improvement :sweat_smile:

Thank you for sharing this, @ffatty!

Hello there, I am trying to access Quickadd Plugin. This is my step by step

  1. Make the specified quickadd capture/template available in command by clicking the lightning symbol
  2. Doing the same step as you did

This is my URI code

obsidian://advanced-uri?vault=Sasha's%20Drive&commandid=quickadd%253Achoice%253A4f2ac2d5-0cd2-4efb-91cd-d875c7bc5bfc

But, unfortunately, when I tried it on my android/macrodroid, the intent could only open my obsidian without even running the command. Do you know why it is so? Thank you

I think the apostrophe in your vault name just needs to be URL encoded.

Try replacing it with ‘%27’?

If I’m ever not sure I check out some tool like this. :slight_smile:

Hi, I tried all that you suggested, however, it still doesn’t work on my android (samsung a50s).

It works perfectly, though, in the laptop, using ahk.

in the meantime, i’ll just search how to make this work. If you find it first, please tell me! Thank you. :smiley:

I just realized the UUID part is for the Advanced URI to identify the file, and you’re doing a capture action not a template action in Quick Add.

EDIT:
I’m guessing the issue might be that you’re using commandid rather than commandname, but passing what appears to be the name of the command from the command pallet as the argument. How did you determine the command ID you’re trying to pass?
You also seem to be missing the uid= part when specifying the file at the end, unless that’s supposed to be part of the commandid in which case you’re missing a target file for the action. If I remember correctly, Quick Add Capture actions need a current file context since they largely target the current file for where they put the results.