I have a shell script which runs a long-running processes in a Terminal window.
I leave it running and work on other Terminal windows.
I'd like to be notified when the shell script finishes, by bringing its window to front.
I have following code, which I wanted to run at the end of the shell script:
tell application "System Events"
tell process "Terminal"
set win to (!code to get current window!)
perform action "AXRaise" of win
but I don't know how to get current window.