Sorry I'm tired so I kinda didn't read the end of your post that well...bad me 😉
You might be better off using the system() function like so:
<?php
// get the user-agent
if (isset ($_SERVER))
{
$ua = $_SERVER["HTTP_USER_AGENT"];
}
else
{
$ua = $HTTP_SERVER_VARS["HTTP_USER_AGENT"];
}
// Check to see if we're running on a mac browser. Cant remember
// off-hand but me thinks there will be a 'PPC' in there somewhere
if (strstr ($ua, "PPC"))
{
// run the command for your mac users
system("run that command here");
...
}
?>
HTH,