Example - Passing a dictionary to a shortcut from macOS

Share your macOS, iOS, and iPadOS shortcuts here. Post your shortcut in a new topic and be sure to describe thoroughly (screenshots, full text of any scripts, apps used, etc).
User avatar
anyone
Posts: 127
Joined: Sun Apr 03, 2011 3:02 pm
Location: Norfolk, VA

Example - Passing a dictionary to a shortcut from macOS

Post by anyone »

I knew you could pass arguments but never found a use, until recently.

Code: Select all

shortcuts run "pass to indigo" <<< '{"message":"indigo.device.toggle", "objectId":"1252158401", "Key Location":"Indigo API Key 2"}'
MODERATOR'S NOTE: amended post title to include "Example"
User avatar
DaveL17
Posts: 7292
Joined: Tue Aug 20, 2013 11:02 am
Location: Chicago, IL, USA
Contact:

Re: Passing a dictionary to a shortcut from macOS

Post by DaveL17 »

That's an excellent tip. Thanks for sharing it! I'm going to add your example to the docs. I'm also going to amend the title of your post to include "Example" to make it easier to find.

One note for folks who may try to run this command from within Indigo: you can't use pipes from the Indigo "Run Shell Script" action item. There's a bit of a hack listed in the docs to get around this. It involves using a shell script as an intermediate step.
I came here to drink milk and kick ass....and I've just finished my milk.

My Plugins and Scripts
Post Reply

Return to “Apple Shortcuts”