Jump to content
raygan

Workflow to simulate using a keyboard shortcut on highlighted text

Recommended Posts

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.

Share this post


Link to post

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

Share this post


Link to post

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

Share this post


Link to post

@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

Share this post


Link to post

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?

Share this post


Link to post
1 minute ago, davidtesler said:

Thanks so much - just sent you a coffee:)

 

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

Share this post


Link to post

@davidtesler I updated the workflow to strip any non-numeric characters from your query (should better work with different phone number format). I'm not sure if Ring Central does it by itself, but based on @raygan's post above it shouldn't and this should help.

 

New workflow: https://d.pr/f/xmMuSE

 

Best!

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...