zwadla
Last Updated: February 25, 2016
·
632
· thinkclay
Cb047b44e7b9492cb9053c697891bfed

Restart Django development server using AppleScript

Sometimes it's quicker to call the script than open Terminal and restart server manually

property applicationName : "Terminal"
tell application applicationName
    activate
    tell application "System Events"
        tell front window of process applicationName
            try
                key code 8 using control down
                keystroke "python manage.py runserver" & return
            on error theError
                display dialog ("Sorry, an error occured:" & theError) buttons "OK" default button "OK" with icon stop
            end try
        end tell
    end tell
    tell application "TextMate"
        activate
    end tell
end tell
Say Thanks
Respond