I’m trying to use Apple Script to execute a shell script file in a new Terminal window, while sending it options. How do I do that?

It seems as if Terminal only interprets the path to the script, and ignores what comes next.

I'd like to use something like that:

do shell script "/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal " & pathToScript & " -option"

The script runs but it doesn't get -option.

Note: I need a Terminal window for user interaction. Running the script directly executes it in the background.

1 Answer 1


The following AppleScript works for me:

tell application "Terminal"
    do script "~/testscript" & " -arg1" & " -arg2"
end tell

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .