Bash osascript(AppleScript) in mac terminal, run multiple commands sequentially
up vote
0
down vote
favorite
I am trying to create a bash .sh script file that uses osascript to open 1 new terminal window/tab and then runs 2 commands "cd fs" and than "gulp" (both in the same window/tab)
This is what I am trying and it runs the second command (do script "gulp") in another (third) window/tab, not the second one that was opened.
osascript -e '
tell application "Terminal"
do script "cd fs"
do script "gulp"
end tell'
bash macos terminal osascript
add a comment |
up vote
0
down vote
favorite
I am trying to create a bash .sh script file that uses osascript to open 1 new terminal window/tab and then runs 2 commands "cd fs" and than "gulp" (both in the same window/tab)
This is what I am trying and it runs the second command (do script "gulp") in another (third) window/tab, not the second one that was opened.
osascript -e '
tell application "Terminal"
do script "cd fs"
do script "gulp"
end tell'
bash macos terminal osascript
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to create a bash .sh script file that uses osascript to open 1 new terminal window/tab and then runs 2 commands "cd fs" and than "gulp" (both in the same window/tab)
This is what I am trying and it runs the second command (do script "gulp") in another (third) window/tab, not the second one that was opened.
osascript -e '
tell application "Terminal"
do script "cd fs"
do script "gulp"
end tell'
bash macos terminal osascript
I am trying to create a bash .sh script file that uses osascript to open 1 new terminal window/tab and then runs 2 commands "cd fs" and than "gulp" (both in the same window/tab)
This is what I am trying and it runs the second command (do script "gulp") in another (third) window/tab, not the second one that was opened.
osascript -e '
tell application "Terminal"
do script "cd fs"
do script "gulp"
end tell'
bash macos terminal osascript
bash macos terminal osascript
edited Nov 9 at 19:53
asked Nov 7 at 21:54
gotime4
499
499
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
I was able to find the answer I was looking for
osascript -e "
tell application "Terminal"
set currentTab to do script "cd $(pwd)"
delay 2
do script "gulp env --env int" in currentTab
delay 5
do script "gulp" in currentTab
delay 30
end tell"
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
I was able to find the answer I was looking for
osascript -e "
tell application "Terminal"
set currentTab to do script "cd $(pwd)"
delay 2
do script "gulp env --env int" in currentTab
delay 5
do script "gulp" in currentTab
delay 30
end tell"
add a comment |
up vote
0
down vote
accepted
I was able to find the answer I was looking for
osascript -e "
tell application "Terminal"
set currentTab to do script "cd $(pwd)"
delay 2
do script "gulp env --env int" in currentTab
delay 5
do script "gulp" in currentTab
delay 30
end tell"
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
I was able to find the answer I was looking for
osascript -e "
tell application "Terminal"
set currentTab to do script "cd $(pwd)"
delay 2
do script "gulp env --env int" in currentTab
delay 5
do script "gulp" in currentTab
delay 30
end tell"
I was able to find the answer I was looking for
osascript -e "
tell application "Terminal"
set currentTab to do script "cd $(pwd)"
delay 2
do script "gulp env --env int" in currentTab
delay 5
do script "gulp" in currentTab
delay 30
end tell"
answered Nov 8 at 21:40
gotime4
499
499
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53198432%2fbash-osascriptapplescript-in-mac-terminal-run-multiple-commands-sequentially%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown