0
我正在使用applescript來打開我的開發環境。點擊一下即可打開開發環境;只有在未激活的情況下激活「系統事件」
UPDATE - 此腳本有效。我將開放的文本轉移到腳本的末尾,現在它運行得更加一致。
tell application "Terminal"
activate
do script "cd web_sites/mydomain" in front window
do script "rvm 1.9.2" in front window
do script "rails server" in front window
end tell
tell application "System Events"
if not (exists process "System Events") then
tell application "System Events" to activate
end if
tell process "Terminal" to (keystroke "t" using command down)
end tell
tell application "Terminal"
do script "cd web_sites/mydomain/public/stylesheets" in front window --> tab 2
do script "rvm 1.9.2" in front window --> tab 2
do script "sass --watch stylin.scss:stylin.css" in front window --> tab 2
end tell
tell application "System Events"
tell process "Terminal" to (keystroke "t" using command down)
end tell
tell application "Terminal"
do script "cd web_sites/mydomain" in front window --> tab 3
do script "rvm 1.9.2" in front window --> tab 3
do script "mate ." in front window
delay 4
do shell script "open -a Firefox http://localhost:3000"
end tell
感謝您的幫助。
我更新了帖子,以反映我明白你的意思。腳本的第二部分還沒有工作。謝謝你的幫助。 – Jay
哪部分不工作?也許我可以幫助更多。 :) – fireshadow52
52它現在的作品。我能夠創建所需的條件語句。謝謝。 – Jay