Jump to content

Workflow to simulate using a keyboard shortcut on highlighted text


Recommended Posts

Posted

I run a softphone VOIP app for work (the RingCentral app). I'd like to be able to type a phone number into Alfred (or select it from a contact) and have it place a call, but RingCentral doesn't seem to have AppleScript support or much else that would help.

 

What it does have is a global keyboard shortcut. I can highlight a 10 digit number anywhere in the MacOS and use a keyboard shortcut to instantly dial the number.

 

Is there any way for Alfred to simulate highlighting some text and then using a keyboard shortcut? I'd like to pass the workflow some text by typing a number into Alfred, then have it "highlight" that text and do the keyboard shortcut for me.

Posted

This should work. Fill the last Key Combo with RingCentral’s shortcut.


Here’s how it works:

  1. You call ring with the number.
  2. Alfred calls itself with the umber (tell application "Alfred 3" to search "{query}").
  3. All text is selected (⇧⌘←).
  4. Ring Central’s keyboard shortcut is called.

0Zp0SKM.png

Posted

Wow, thanks! Very helpful!

 

In the mean time I ended up also asking about this on the RingCentral development forum, and they let me know that the RingCentral softphone app has an undocumented URL scheme for placing calls as well. That turns out to be a cleaner approach. So in the end I'm using a bash script that looks like this:

 

number=$(echo "{query}" | sed 's/[^0-9+]//g')
open "rcmobile://call?number=${number}"

 

Thanks for the help!

Alfred_Preferences.png

Posted

@raygan, if there's a URL scheme then you can just use the Alfred "Open URL" object with your query ("rcmobile://call?number={query}") if you want a simpler workflow

  • 1 year later...
Posted

Sorry to bother you folks - I would really like a workflow for ringcentral - but I cant follow the above - does anyone have a workflow I could download or instructions to how to set up?

Posted
1 minute ago, davidtesler said:

Thanks so much - just sent you a coffee:)

 

Great, thanks! Really appreciated! I'm glad this was useful!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...