Skip to content

Instantly share code, notes, and snippets.

@tomslominski
Last active December 14, 2015 12:20
Show Gist options
  • Save tomslominski/7af635eeef71cf60bba8 to your computer and use it in GitHub Desktop.
Save tomslominski/7af635eeef71cf60bba8 to your computer and use it in GitHub Desktop.
Automator script to open the MAMP PHP error log in nearest terminal window - save as Automator application, export to your Applications folder
on run {input, parameters}
tell application "Terminal"
activate
if (count windows) is 0 then
do script with command "tail -f /Applications/MAMP/logs/php_error.log"
else
repeat with win in windows
try
if get frontmost of win is true then
tell application "System Events" to keystroke "t" using {command down}
delay 0.5
do script with command "tail -f /Applications/MAMP/logs/php_error.log" in (selected tab of win)
end if
end try
end repeat
end if
end tell
end run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment