Script using 'do shell script' works great and then hangs!

Hello, my name’s Alex and I’m a videomaker and minor geek.

I’m currently writing a little script that uses a “do shell script” command in order to process a chosen file with a unix executable.

What is supposed to happen is that you drag the file-to-be-processed onto the script application, and it runs a shell script after which the shell script quits and the applescript too. It’s really simple. Here’s my code:

on open this_file
	set fileName to quoted form of POSIX path of this_file as string
	do shell script "/Applications/The Name And Location Of The Executable " & fileName
end open

“The Name And Location” etc. is an actual name and location (I don’t think there is anything wrong with that path or its formatting so I’m leaving it out so I can maintain a wee bit of privacy about my project).

So, what happens when something is dragged onto this script is that it launches and the file is processed 100% correctly by the executable – everything works perfectly, except that then the script hangs with the spinning beachball of death and has to be force-quit.

Does anyone know why the script freezes after successfully accomplishing its goals?

Many thanks in advance for any assistance,


Do you know what’s going on in the command-line top-secret tool? Does it return a result? Perhaps it returns a odd result or something which does crash your applescript… What if you enclose the “do shell script” call inside a “try/end try” block?

I am experiencing the exact same problem…

when looking at top, when I run my script (which is just opening an xTerm window):

do shell script "export DISPLAY=:0.0; export PATH=$PATH:/usr/X11R6/bin; xterm -geom 80x36+225+195 &"

I do not see anything odd happening with processes when using top during this… Once I close the xterm window, the applescript frees up-- I dont understand why this is, can someone tell me?