How would I have a button on a local webpage (running locally on localhost) to open a local application on OSX?
I have looked through some answers for windows but can't figure out how to get it to work on OSX.
I'm using MAMP on my Mac OS X (high sierra), and in PHP the code is :
$command = '/Applications/Safari.app/Contents/MacOS/Safari';
$escaped_cmd = escapeshellcmd($command);
Have tested this and it does work in opening up the application locally. You can even call it from the Terminal to test if it works after creating the above code in a .php file.
Example in Terminal on Mas OS X:
Share solution ↓
Link To Answer People are also looking for solutions of the problem: zsh: command not found: php
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.