使用AppleScript重新启动Django开发服务器

【使用AppleScript重新启动Django开发服务器】满堂花醉三千客,一剑霜寒十四洲。这篇文章主要讲述使用AppleScript重新启动Django开发服务器相关的知识,希望能为你提供帮助。

  1. property applicationName : " Terminal"
  2. tell application applicationName
  3. activate
  4. tell application " System Events"
  5. tell front window of process applicationName
  6. try
  7. key code 8 using control down
  8. keystroke " python manage.py runserver" & return
  9. on error theError
  10. display dialog ( " Sorry, an error occured:" & theError) buttons " OK" default button " OK" with icon stop
  11. end try
  12. end tell
  13. end tell
  14. tell application " TextMate"
  15. activate
  16. end tell
  17. end tell
  18.  


    推荐阅读