Best answer

Global keyboard shortcut as trigger?

  • 2 March 2021
  • 4 replies
  • 128 views

I’d like to trigger a zap just by typing a keyboard shortcut (on my Mac) from within any app. Lots of apps have these (e.g. LaunchBar, OmniFocus), but I can’t find one that will let me enter text to send to a zap.

Zapier has some nice triggers of its own. Can it make one for a global shortcut trigger?

Any Mac users have other ideas?

 

Thanks in advance.

icon

Best answer by olderbrother 9 March 2021, 15:41

View original

4 replies

Userlevel 7
Badge +14

Hi @olderbrother 

You can submit feature requests here: https://zapier.com/app/get-help

 

Check out the Zapier Chrome extension: https://chrome.google.com/webstore/detail/zapier/ngghlnfmdgnpegcmbpgehkbhkhkbkjpj?hl=en

Userlevel 7
Badge +12

Hi @olderbrother

 

I use Alfred to trigger apps with that type of Keyboard shortcut, here’s a link to the Alfred website if you want to learn more about the app). You can set up workflows in Alfred that trigger with keyboard commands and send webhooks using Apple Script. You can then use the Catch hook trigger for the Webhooks by Zapier integration to trigger a Zap. 

 

 I’m not familiar with LaunchBar or Omnifocus, but if they can do the same then you should be able to put something together. 

 

If you have (or would consider using) Alfred, we have a blog post that explains how to set up a Zap using Alfred: Zapier for Alfred blog post

 

I hope that helps! 🙂

Hey, @Danvers, thanks for the tip. I may eventually switch to Alfred, but I’m already using the similar LaunchBar. Fortunately, the process of setting up such a zap with webhooks and AppleScript is probably about the same. I’ll check it out and see what I can come up with!

 

I found a way! Borrowing some code from various places and tweaking, I use Script Editor (on every Mac) to make an AppleScript for adding tasks with notes to Asana. I saved it as an application, so I can just run it using any app launcher’s keyboard shortcut (Spotlight, LaunchBar, Alfred, etc.). I called my app “Add to Asana,” so I just type “aa” and hit return. Very quick.

Here’s the code if anyone wants to try it out:

set prompt to "Task name:"

set dialogResult to display dialog prompt ¬

buttons {"Cancel", "OK"} default button 2 ¬

default answer "task name"

set theProjectTitle to text returned of dialogResult

 

set prompt to "Notes:"

set dialogResult to display dialog prompt ¬

buttons {"Cancel", "OK"} default button 2 ¬

default answer "notes"

set theNotes to text returned of dialogResult

 

set url_text to "curl -X \"POST\" \"https://app.asana.com/api/1.0/tasks\" -H \"Authorization: Bearer 1/REPLACE THIS WITH YOUR PERSONAL ACCESS TOKEN\" -H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' --data-urlencode \"workspace=REPLACE THIS WITH YOUR WORKSPACE ID\" --data-urlencode \"assignee=REPLACE WITH ASSIGNEE’S EMAIL\" --data-urlencode \"name=" & theProjectTitle & "\""

 

set url_text to url_text & " --data-urlencode \"notes=" & theNotes & "\""

 

set response to do shell script url_text

-- display dialog (url_text as text)

-- display dialog (response as text)

Reply