MacOS Shortcut update

A while back, I put this in: MacOS 12 Shortcut

And it was good. But I thought I’d update how I’m using it now.

The change here is that I’ve created an “Inbox” - it’s a folder within a Vault. That is my ‘dumping’ location for notes that need a quick capture.

Then in File Path, if you right click, you can get Current Date as an option. If you set it to custom, you can use unicode standards. I like mine, of course, with yMMdhhmm as that will give a straight number that stays in order.

To me, this beats having to have something like Drafts in order to have a menubar capture. It also works on your watch, etc…

Hopefully this might mean one less app to worry about, and more Obsidian ease!

1 Like

Here’s a link to my copy.

https://www.icloud.com/shortcuts/77c5879f9b5643a29714efb6cc8c7477

Also, it’s sort of fun because you can call the shortcut with Siri and dictate into your watch. You can also Shortcut > Details > Add To Home Screen on your phone - and your phone will also allow dictation. It’s on a share sheet, too.

It’s almost absurd what’s built in.

1 Like

Very useful. Thanks for sharing. :+1:

I am trying to get it to run so it appends text to one Markdown file in my inbox. It works if the file has a .txt extension, but so far I haven’t found a way to get it to work with an .md file. If I do get it to work, I’ll post the shortcut here. I am hoping to create a log file where each line starts with an automatic date stamp.

Surprised :flushed: that more users haven’t been taken by this … a speedy way of adding a note to Obsidian.

1 Like


Here… this one has creation date.

1 Like

Thank you so much. :star_struck:

I will try to get this to work locally. My attempts so far have not matched the logic you use with multiple appends, so I am very grateful for the shared ideas. I was clearly going about this the wrong way entirely.

1 Like

With thanks for the guidance of @matchavez, the Shortcut below adds a bullet-point date-and-text entry to a specified file in a specified folder, both of which need to be personalized by editing the Shortcut to point the the user’s vault > subfolder > file name. It also adds a commented date-and-time entry at the end of each line (which I need in my vault if I ever want to look back and see when the line was created).

On macOS, it can be added to the dock, menu bar, and Share Sheet, and given a keyboard shortcut. Obsidian does not need to be running for it to work.

On iOS, it can be added to the Home Screen and Share Sheet. Again, Obsidian does not need to be running for it to work.

Obsidian Shortcuts Note.zip (12.4 KB)

1 Like

My version of this — explanatory post, Shortcuts

Same idea (dictate or share anythnig into your Vault), I prefer appending to a Daily Note with the time and location of the note. Probably use it 3-10 times a day :slight_smile:

This is exactly what I’m trying to do—to be able to dictate ideas into Obsidian while I’m on a bike, and my hands aren’t available. I was going to ask how to save a file to the Obsidian vault when you don’t have access to the folder, but I see now that the Obsidian folder is accessible in my local phone files.

  • Is there a way to specify different base paths on iPhone/watch/Mac?
  • If I move the vault on my Mac to an Obsidian folder under my user folder, will the same path work?
  • Once I dump the file into the appropriate Obsidian folder, how do I get Obsidian to sync the file? I’m guessing I need to run the app on whatever device I used to dictate the note. Will that work on my watch too?

This is my original post asking about using Drafts to send notes to Obsidian.

  • My original plan was to use Drafts to set the note title and add YAML.
  • I can pull the creation date in Drafts, which ensures that the file name and creation date/time agree exactly.
  • If I can access the Obsidian vault folder in Shortcuts, I may be able to do it in Drafts. That’s a bit more complicated because of sandboxing, but Drafts has a workaround.
  • I may be able to set the YAML in Shortcuts as well, so long as I can figure out how to edit the text of the note.
  • I’m setting the filename to the current time, down to the second, so I’ll need to set a filename variable to keep it from varying across actions.
  • If the file is created at a slightly later time than when setting the filename, then the creation date/time won’t agree with the name.
  • Is it possible to pull the file creation date/time in a shortcut?

Thanks for the idea—this will probably solve my problem; I just need to get more comfortable with Shortcuts.

1 Like

@matchavez I got basically this method to work in Drafts, but I’d like to try using a shortcut instead because that goes directly to Obsidian. I was able to download an example and get it to work on my Mac and iPhone, but I’ve got one question:

  • I figured out that file paths work basically the same as Drafts bookmarks—just click the button and set the path.
  • You mention this works on the Apple Watch. I can invoke the shortcut, but it can’t find my inbox folder. How do I tell it where to send the file?

Thanks,

Ken Tryon

1 Like

I don’t have an Apple watch, but to get the shortcut to point to the iCloud-stored vault on my Mac and iPhone, I needed to set the folder and file name for each of the append steps—see the image below. Not the same setup for the Apple Watch? (My use is simple in that I use one file to capture thoughts during the day, appending timestamped entries that I can edit or move later on.) Hope @matchavez can help.

1 Like

@Hampton Thanks for the reply. There is no way to edit the script on the Apple Watch, so I can’t do this. I will probably have to use Drafts on the watch, since that syncs to its own library automatically. There may be a way to do this with a shortcut on the watch, but it will take some more digging.

Edit: I could save to an Apple quick note from the watch, then run a shortcut later on my phone to add that to Obsidian. Still two steps, but it eliminates the need for Drafts.

I name my files with the creation date and time, and for some reason my phone complains that the file doesn’t exist when I use a variable in the filename, but it works fine on my Mac. I can use exactly the same folder and just change the name, and it won’t work. That feels like a bug or some kind of obscure behavior—I’ll probably have to make a phone version of the script and tweak it to work properly.

Thanks again for the tip—it’s gotten me most of the way to where I want to be.

1 Like

If the shortcut works correctly on the iPhone, it’s the same thing on the watch. Your watch is just invoking the phone actions (I think). So effectively if you Siri your watch and say the title of the Shortcut, it prompts for text input via voice, and then the phone converts that to text and follows those instructions on the phone shortcut - thus making them indistinguishable in that sense.

If you want to get totally nerdy about it, you can create two shortcuts, and only use one on your phone, and only use the other when you’re on your watch - and the watch can be pointed to a different folder or use a different naming convention. Just be aware that the two shortcut “titles” and what you would verbally call them via Siri would have to be easily distinguishable for your own usability.

(e.g. you can make two shortcuts named ‘watch note’ and ‘phone note’ - both will be usable, but it will be obvious to you not to ask Siri for ‘watch note’ while using your phone.)

Great extension of the work, @tryonk and thanks to @Hampton for doing a great job of explaining Shortcuts use of paths!

1 Like

@matchavez Thanks for the tip. I hadn’t gotten the shortcut to work on my watch, but that was likely because it’s not working on my phone in its current iteration. If I use a variable in the filename on my MacBook (I use the date and time in a 14 digit format, same as I use for my Zettelkasten notes), it works fine there. The same shortcut using the same folder hierarchy fails on my phone. I know it isn’t a path problem, because the shortcut works fine both places if I don’t use a variable in the name. It smells like a bug in the iPhone Shortcuts app.

I can still append my random thoughts into a journal note with a timestamp, then extract them with the Compose Note feature—I’ve seen references to that, but I haven’t read up on how it works yet. Given that I’m not going to be able to dictate a note title and tags while I’m riding my bike anyway, trying to specify a timestamped filename is probably overkill. What a geek wants is often not what a geek needs. :smirk:

Where a full-blown file template could be useful is when pulling text from a webpage or another app via a share sheet. I have that option coded into my shortcut, but I need to develop the share sheet option further.

FWIW, this is the current state of my shortcut: Shortcuts

I’ll share my Drafts actions as well, but I need to remove my personal information first.

1 Like

To add to this, two Shortcuts are not absolutely necessary. There’s a shortcut action Get Device Details to detect which device is calling the Shortcut and then branch off into doing something different if it is a watch.

1 Like