Do I need to create two quasi-identical shortcuts for Mac and iOS

I have a silly question. I keep my obsidian on iCloud. Thus iCloud/Obsidian is my homevault on my laptop, yet on the mobile app I cannot choose the whole /Obsidian as my vault, so I have to choose /Obsidian/The Vault as the vault folder.
As consequence I have to make two versions of shortcuts for my laptop and for my phone with the sole difference being the specification of paths to notes\folders.
Is there a way around it?

Check the Device Type of Device Details to check for Mac, iPhone, iPad, or Watch. You can do this right in the If parameter, but if you prefer it’s also possible to use Get Device Details action and Set Variable if you might need to check it in several places.

  1. Use an If action to provide device-specific actions.

  1. Right click on the Input parameter, and select Device Details.

  1. Select Device Type in Device Details.

  1. Choose Mac (or iPhone) for the Condition parameter, depending on what you want to test first.

  2. In the If- true block, include Mac-specific actions such as Show Alert that indicates the Health app is only available on iPhone, and then Stop the Shortcut. If you had a Mac-specific action here, then this would show as The action is not available on the iPhone.

  3. Within the Otherwise (If false) block, include the iPhone actions like Find Health Samples. On the Mac, this will show as The action is not available on the Mac.

If there are many actions in each block, it might make sense to create mini-shortcuts (like function subroutines) and use Run Shortcut within If blocks. That will simplify the main shortcut quite a bit.

Although this means that you will then have at least 3 shortcuts instead of 2 (Mac and iPhone), you won’t have so much duplicate code and it might make it easier to maintain your shortcuts.


Thank you so much!
That looks like a solution to me. Will try to implement it in the next couple days.

May be I didn‘t get it right, but…
When using iCloud for application on mobile, every app creates its own folder. So if you create a vault named Obsidian on your mobile, it will located under iCloud/Obsidian/Obsidian. And this should also be the path on your Mac. So just move your Vault on the Mac out of the iCloud folder and create a empty Obsidian folder and copy it back or sync it back from your mobile. Never the less not sure why you asked. What kind of use case you have. If you use your as you describe I would assume, that you will end up with your vault on your Mac containing an sync copy vault as folder from your mobile. Currently I‘m not as good connected to the internet as normal. So it might take some time for an answer.

1 Like

Thank you for your answer! It made me rethink the situation once again and I figured out that the problem wasn’t in the phone, but on my laptop. I changed the root file of the vault on it and now everything works :slight_smile:

Great, that this helps to find a solution.