15

In Yosemite, is there a way to start a phone call from the command-line aka Terminal?

Something like:

call +316123456789
18

You can with open "tel://+316123456789" start a phone call process - but you still need to click on the "Call" button to make the call.

enter image description here

To do so, you may also simply press . To automate everything via Applescript:

open location "tel://+351918306031"
delay 2
tell application "System Events" to key code 36
  • What app does this? – user151019 Nov 27 '14 at 19:44
  • 5
    This is "Phone calls via iPhone" - also known as "Mac + iOS Continuity" (Yosemite + iOS8). – Rene Larsen Nov 27 '14 at 20:07
  • 1
    FWIW it appears that pressing the Enter/Return key will press the 'Call' button, which may make automating this a little easier. – TJ Luoma Dec 4 '14 at 0:44
  • If you don't have an iPhone, this will call using FaceTime, so the receiver will need to be an address that has that. – Haroen Viaene Dec 3 '15 at 15:59
  • I tried using this method for creating a "one-click" phone number to automate testing a menu system. The number eventually got too long, and it stopped working. – M. Scott Ford Oct 12 '17 at 15:40
1

In theory, you could use Automator to setup a sequence of actions to trigger making a call. I've never actually used Automator, but my understanding of it says it'll work.

First, you could create an Automator script that perhaps triggers Rene's answer of running open "tel://+316123456789" and clicking the 'Call' button. Or, you could have it open the Google Hangouts Chrome Extension and similarly dial a number.

Second, you would call the Automator script from the command line (as described here):

open MyAutomatorCaller.app --args '+316123456789'

Lastly, you could create a Bash alias for the above command (i.e. in ~/.bash_profile):

call() { 
    open MyAutomatorCaller.app --args $1
}

You must log in to answer this question.

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