Alex Marshall

Admin

Log out

How to run Shortcuts from a URL

06.06.2024

|

Projects

This is a summarised version of what can be found on the Apple website - Run a shortcut using a URL scheme on iPhone or iPad

tldr;

Use this URL scheme shortcuts://run-shortcut?name=[name] where [name] is the name of the shortcut, case matched. Use %20 to represent spaces.

Example - shortcuts://run-shortcut?name=Add%20weather%20forecast%20to%20notes

You can also pass an input using a parameter - details below

————————

I recently set up a Shortcut to automatically create link-dump blog posts in Bear based on a collection of links saved in Anybox. You can read more about how I set it up here

I added a pinned note in Bear with details of how the shortcut works, just in case I need to remind myself in the future. I decided as well that it’d be handy to have a place from which to quickly run that shortcut. It’s a shortcut that I’ll only run once a month so it didn’t need a permanent widget on my dashboard or anything like that, so I thought it’d be handy to be able to run it from this pinned note.

I wasn’t sure how I was going to do this, because I didn’t realise that Shortcuts can be run from a URL. Turns out this is very easy to set up. Here’s the instructions from Apple

Open a URL with the following structure: shortcuts://run-shortcut?name=[name]&input=[input]&text=[text]

Use the following parameters in the URL:

  • name: The name of the shortcut to run.

  • input (optional): The initial input into the shortcut. There are two input options: a text string or the word clipboard. When the input value is a text string, that text is used. When the input value is Clipboard, the contents of the clipboard are used.

  • text: If input is set to text, then value of the text parameter is passed as input to the shortcut. If input is set to clipboard, then this parameter is ignored.

By using a text string, you can provide your own URL-encoded text as input to the shortcut. For example, a URL that uses the text “goetta is great” as input to a shortcut named Lookup Goetta would look like this:
shortcuts://run-shortcut?name=Lookup%20Goetta&input=text&text=goetta%20is%20great

A URL to transfer the most recently copied text into a shortcut called Add to Notes would look like this:
shortcuts://run-shortcut?name=Add20%to20%Notes&input=clipboard

This is a summarised version of what can be found on the Apple website - Run a shortcut using a URL scheme on iPhone or iPad

tldr;

Use this URL scheme shortcuts://run-shortcut?name=[name] where [name] is the name of the shortcut, case matched. Use %20 to represent spaces.

Example - shortcuts://run-shortcut?name=Add%20weather%20forecast%20to%20notes

You can also pass an input using a parameter - details below

————————

I recently set up a Shortcut to automatically create link-dump blog posts in Bear based on a collection of links saved in Anybox. You can read more about how I set it up here

I added a pinned note in Bear with details of how the shortcut works, just in case I need to remind myself in the future. I decided as well that it’d be handy to have a place from which to quickly run that shortcut. It’s a shortcut that I’ll only run once a month so it didn’t need a permanent widget on my dashboard or anything like that, so I thought it’d be handy to be able to run it from this pinned note.

I wasn’t sure how I was going to do this, because I didn’t realise that Shortcuts can be run from a URL. Turns out this is very easy to set up. Here’s the instructions from Apple

Open a URL with the following structure: shortcuts://run-shortcut?name=[name]&input=[input]&text=[text]

Use the following parameters in the URL:

  • name: The name of the shortcut to run.

  • input (optional): The initial input into the shortcut. There are two input options: a text string or the word clipboard. When the input value is a text string, that text is used. When the input value is Clipboard, the contents of the clipboard are used.

  • text: If input is set to text, then value of the text parameter is passed as input to the shortcut. If input is set to clipboard, then this parameter is ignored.

By using a text string, you can provide your own URL-encoded text as input to the shortcut. For example, a URL that uses the text “goetta is great” as input to a shortcut named Lookup Goetta would look like this:
shortcuts://run-shortcut?name=Lookup%20Goetta&input=text&text=goetta%20is%20great

A URL to transfer the most recently copied text into a shortcut called Add to Notes would look like this:
shortcuts://run-shortcut?name=Add20%to20%Notes&input=clipboard

This is a summarised version of what can be found on the Apple website - Run a shortcut using a URL scheme on iPhone or iPad

tldr;

Use this URL scheme shortcuts://run-shortcut?name=[name] where [name] is the name of the shortcut, case matched. Use %20 to represent spaces.

Example - shortcuts://run-shortcut?name=Add%20weather%20forecast%20to%20notes

You can also pass an input using a parameter - details below

————————

I recently set up a Shortcut to automatically create link-dump blog posts in Bear based on a collection of links saved in Anybox. You can read more about how I set it up here

I added a pinned note in Bear with details of how the shortcut works, just in case I need to remind myself in the future. I decided as well that it’d be handy to have a place from which to quickly run that shortcut. It’s a shortcut that I’ll only run once a month so it didn’t need a permanent widget on my dashboard or anything like that, so I thought it’d be handy to be able to run it from this pinned note.

I wasn’t sure how I was going to do this, because I didn’t realise that Shortcuts can be run from a URL. Turns out this is very easy to set up. Here’s the instructions from Apple

Open a URL with the following structure: shortcuts://run-shortcut?name=[name]&input=[input]&text=[text]

Use the following parameters in the URL:

  • name: The name of the shortcut to run.

  • input (optional): The initial input into the shortcut. There are two input options: a text string or the word clipboard. When the input value is a text string, that text is used. When the input value is Clipboard, the contents of the clipboard are used.

  • text: If input is set to text, then value of the text parameter is passed as input to the shortcut. If input is set to clipboard, then this parameter is ignored.

By using a text string, you can provide your own URL-encoded text as input to the shortcut. For example, a URL that uses the text “goetta is great” as input to a shortcut named Lookup Goetta would look like this:
shortcuts://run-shortcut?name=Lookup%20Goetta&input=text&text=goetta%20is%20great

A URL to transfer the most recently copied text into a shortcut called Add to Notes would look like this:
shortcuts://run-shortcut?name=Add20%to20%Notes&input=clipboard

Similar posts

How I built a Shortcut to automate creating 'link-dump' blog posts

12.05.2024

Shortcut for creating QR codes that link to photo albums

24.07.2023

Using Shortcuts to store the details of wines that I like

29.05.2023