I have a simple AppleScript (packed as an app) that tells the Terminal to execute a couple of lines of code. Every so often -- about once every 7 to 10 days -- after a cold restart, the code has been "corrupted" somehow and the word "Terminal" in the Tell statement has been changed to "Applet" and the "do script" commands have been replaced by "«event coredosc»". I've been fixing this by just clicking edit on the error prompt and pasting in the right code for the app. Has anyone encountered this before? None of my other AppleScripts (also packaged as apps) that tell the Terminal to do things has this problem. Does anyone know how to fix this? I've also tried re-typing the app's sourcecode from scratch in a new AppleScript app and no dice.
I am using OS X 10.8.4. Here is the script:
set myProcessInfo to do shell script ("ps -x") if myProcessInfo contains "httpd" and myProcessInfo contains "mysql" then do shell script "/Applications/MAMP/bin/stopApache.sh" do shell script "/Applications/MAMP/bin/stopMysql.sh" else tell application "Terminal" do script "/Applications/MAMP/bin/startApache.sh" do script "/Applications/MAMP/bin/startMysql.sh > /dev/null" end tell delay 10 do shell script "killall Terminal" end if