- Code: Select all
set dialogReply to display dialog " Choose which PHP version you want XAMPP to use" buttons {"PHP5", "PHP4", "Cancel"} default button 1
try
if button returned of dialogReply is "PHP5" then
do shell script "/Applications/xampp/xamppfiles/mampp php5" with administrator privileges -- stop xampp
else
if button returned of dialogReply is "PHP4" then
do shell script " /Applications/xampp/xamppfiles/mampp php4" with administrator privileges -- restart xampp
end if
end if
on error errMsg number errNum from errFrom partial result errResult to errTo
display dialog errMsg
end try
activate
display dialog " The PHP Switch is complete!" giving up after 5
Copy to your scipt editor and save to the Script Menu folder if you prefer.