Make calls automatically with Voxbi for macOS
Voxbi Desktop integrates with macOS to make calls either by clicking phone number links or by simply highlighting (selecting) a phone number on any page or application and pressing a keyboard shortcut.
What follows are instructions to enable both.
Before starting, open Voxbi Desktop and login to your PBX account.
Phone number links
In well designed web pages, phone numbers are displayed as tel:// links. They look like a regular link, but clicking on them will start a call using the Mac's default phone application. To set Voxbi Desktop as you main phone app, first open the FaceTime application, then on top menu click on FaceTime, and chose Settings…
On top of the FaceTime settings window, select the General tab.
On the very bottom, click on the dropdown Default for calls: and select Voxbi.
To test it, navigate to Mixvoip's Contact page and click on a phone link.
Keyboard shortcut to call any selected text
It works like this:
- select a number's text anywhere; by anywhere we mean on a page, app, or even on a picture if your Mac supports selecting text from images;
- press the configured keyboard shortcut (you’ll create one following the instructions below);
- Voxbi will call the selected number.
Automator script, easy way
To enable the above functionality, we need an Automator script with a keyboard shortcut assigned to it.
Voxbi comes with the required script packaged. The easiest way to put it in the right place is to run the command below on the Terminal (it's in the Applications folder, Utilities subfolder).
cp -R /Applications/Voxbi.app/Contents/Resources/Call\ with\ Voxbi.workflow ~/Library/Services/
If you prefer write the script yourself from scratch, scroll down to the instructions on how to do it.
Enable the script
With the script in place, follow these steps assign a keyboard shortcut to run it.
- Open System Settings (it's in the Applications folder), scroll the left side panel all the way down to the bottom and select Keyboard.
- The Keyboard Shortcuts… button should be visible in the middle of the Keyboard settings panel. Click on it.
- From the list on the left, chose Services, then open the Text category. The available actions are in alphabetical order, scroll to find our script called Call with Voxbi (the name might be different if you re-created the script yourself).
- By default, scripts do not get a keyboard shortcut assigned. At the end of the Call with Voxbi line you should see none.
- Double click on none and it will become a text field with a blinking cursor. Press simultaneously the keys you want to have as a shortcut and they will be immediately displayed.
Now select any text on any number and press your shortcut to make a call.
Your Mac will display a security alert asking if you authorize the running app to control “System Events”. This will happen once for every app you invoke the Call with Voxbi script from.
Write the Automator script from scratch
First you need to open Automator (It’s in the Applications folder).
- On Automator's top menu chose File, then New (or CMD+N).
- From the dialog box, chose Quick Action.
- On the search box, type run or AppleScript, then drag and drop the Run AppleScript action to the empty area. Your Automator should look like the image below.
- Delete the existing script skeleton, then copy and paste the script below in it's place.
on run {input, parameters}
if input is not equal to "" then
set phoneNumber to input as text
set encodedNumber to do shell script "python3 -c 'import urllib.parse; print(urllib.parse.quote(\"" & phoneNumber & "\"))'"
set voxbiURL to "voxbi://call?" & encodedNumber
-- Ensure Voxbi is running
tell application "System Events"
set appList to (name of every process)
if "Voxbi" is not in appList then
do shell script "open -a 'Voxbi'"
delay 2 -- Wait a bit for the app to launch
end if
end tell
-- Now make the call
do shell script "open \"" & voxbiURL & "\""
end if
end run
- Change the first dropdown from Automatic (Nothing) to text. You may also change the image and color, but this is optional and won't affect the script operation.
- Your Automator script should look like the image below.
AppleScript depends on the code alignment to work correctly, please double check your script. It should look like above.
- Save your Automator Quick Action and give it a name. We suggest Call with Voxbi for easy identification.
- Scroll back up and follow the instructions in the Enable the script session.