javascript - Return value to trigger quit in safari -


is there way return value or listen event using applescript occur in javascript code know when do javascript has completed , example, tell browser quit.

edit

tell application "safari"  	tell window 1  		set current tab make new tab properties {url:""}  		do javascript "" in current tab  	end tell  	quit  end tell

you don't need wait. do javascript event in safari won't return until javascript code has completed. can verify running:

tell application "safari"   javascript "alert('hello')" in first tab of first window   display dialog "done" end tell 

note "done" dialog doesn't appear until js dialog has been dismissed.


Comments