I have a script wherein I need to run an executable from a terminal
the script is as below
tell application "Terminal"
activate
set run_cmd to "sudo <path to my executable>"
do script run_cmd
end tell
but this times out with the error message
error "Terminal got an error: AppleEvent timed out." number -1712
I even tried using a timeout like
with timeout of 5000 seconds
tell application "Terminal"
activate
with timeout of 5000 seconds
set run_cmd to "sudo <path to my executable>"
do script run_cmd
end timeout
end tell
but no luck it still times out...
This behaviour is observed sometimes , not always. I'm using El Capitan Mac OS.
I got a chance to test on Sierra and High Sierra and it works alright there.
Any idea, how can we solve this issue ?
Note: If I open a terminal before running this script, then it executes without any problems.
Thanks in advance