Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Create a dockable X11 application' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create a dockable X11 application
Authored by: Eponymous on Mar 09, '04 09:51:30AM
A nice addition would be to have the script quit itself when you close Gimp. The bit below is just modified from the original and checks for "gimp" in running processes, then quits if that isn't found. Note that it ignores "MacGimp" which is in the name of my version of the script; you'll want to get rid of that part if you have a name that doesn't include "gimp".

I can't get it to quit by putting the "tell me to quit" within the repeat loop, which seems odd to me.

This also breaks the "on quit" bit posted earlier, presumably because the script is looping through the repeat and can't look for a "quit" message. Should be a way around that, no?


repeat
	set isRunning to 0
	try
		set isRunning to do shell script "/bin/ps -auxww | /usr/bin/grep gimp | /usr/bin/grep -v MacGimp | /usr/bin/grep -vc grep"
	end try
	if isRunning is 0 then
		exit repeat
	end if
	delay 10
end repeat

tell me to quit


[ Reply to This | # ]