1

How can one write a shortcut that receives input from Spotlight search GUI (e.g. command+space)? I'd like to press command+space and type "ticket 12345", then have the shortcut generate the URL and open it in Safari. I've done this for years in Alfred with their custom workflows, but I'd like to do it in Spotlight too.

For example, I want to be able to use Spotlight to open a webpage for a specific support ticket number. The URL for the support system can be broken into a base URL and a parameter. I've created a shortcut called, "ticket" that I can run from Spotlight, but that shortcut has to open a window to ask for input.

On the command line this can be accomplished with the following syntax.

shortcuts run ticket <<< 121345

I'd looking for a way to accomplish the same thing when entering text in the Spotlight search field (command+space).

1 Answer 1

0

Shortcut results can be used; Spotlight results cannot.

You wouldn’t want to do use Spotlight results anyway as you might have a ticket, a text file, even a contact email, or even an address with a zip code that matches. A best practice would be to go into the ticket itself to validate your input as correct.

Once you’ve done that you can then have your Shortcut Receive Safari Webpages and URLs as input from the Share Sheet. You do that, you can process the URL however you deem necessary.

I’ve attached a Shortcut that creates a Follow-up ToDo task (in Microsoft ToDo) based on the question I happen to be viewing at that moment. See below:

enter image description here

enter image description here

Conclusion

As you can see the Shortcut Logic doesn’t have to be extensive to work. The bulk of it will be b what you want to do with the data once you’ve captured it.

1
  • I agree that I do not want to use Spotlight results as input to the shortcut. I want to input both the shortcut name and the shortcut argument. On the command line this could be done with the following syntax, shortcuts run ticket <<< 121345.
    – EricB
    Commented Apr 3 at 19:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .