Script won't quit after calling another script

Hi all. I wrote an applescript that is supposed to call another applescript using the osascript command. but the problem is it won’t quit

i do

do shell script “/usr/bin/osascript > /dev/null 2>&1”
quit

the other applescript that i’m calling here is a script that tries to log you out after a period of time. it works fine by itself and from the command line. It’s just when i call it from another applescript that i have the problem where the applet won’t allow itself to be quit.

any ideas what’s going on?

You didn’t quite finish the ‘do shell script’ command.

The ‘> /dev/null 2>&1’ will suppress all command output, but you forgot to tell the script to run in the background, therefore ‘do shell script’ is waiting for the process to terminate.

The solution is simple. Append an additional “&” to the end of the do shell script command:

do shell script "/usr/bin/osascript <command> > /dev/null 2>&1 &"

The trailing ampersand tells the shell to execute the command in the background, returning control to your script.

Thanks!