/ freenet-stop.applescript
freenet-stop.applescript
 1  on clicked theObject
 2  	try
 3  		-- Read in the preferences
 4  		set theLocation to POSIX path of (call method "defaultObjectForKey:" with parameter "location")
 5  		do shell script "cd " & theLocation & ";sh stop-freenet.sh"
 6  		tell progress indicator "progress" of window "main" to stop
 7  	on error
 8  		display dialog "Freenet server specified in freenet.pid is not running."
 9  		tell progress indicator "progress" of window "main" to stop
10  	end try
11  end clicked