0

This might be a bit of a dumb question as I'm new to AppleScript, but I'm trying to run a very simple shell script in terminal using AppleScript. The code I'm currently using is:

tell application "Terminal"
    do script "videoLoop"
end tell

but I keep getting the error

-bash: fork: Resource temporarily unavailable

Could I also just type "videoLoop.sh" into terminal using AppleScript?

Any help would be appreciated

1
  • 1
    Just use do shell script "/full/path/to/videoLoop" Commented Nov 13, 2014 at 19:48

1 Answer 1

1

If you need it to open a terminal window use something like this:

tell application "Terminal"
    do script "/Users/youruser/testdir/hello.sh"
end tell

Else, if you just want it to run the script do something like this:

do shell script "/Users/youruser/testdir/hello.sh"

You need the full path, and your script needs execute permissions.

My examples just echo the standard Hello World text but the same should work for most other scripts provided they're written properly.

Sign up to request clarification or add additional context in comments.

1 Comment

This did it - actually, I'm not entirely sure why (but I'm guessing it has something to do with the program being run within the shell script), but just doing it with the {do shell script "/Users/youruser/testdir/hello.sh"} causes some weird looping error... so I have to use the Terminal version (or figure out what's causing the other error :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.