do shell script "rsync -tru username@remote.host:'remote/path/to/file/kgtd.oo3/' local/path/to/file/kgtd.oo3/" tell application "Finder" open document file "kgtd.oo3" of folder "file" of folder "to" of folder "path" of folder "local" of startup disk end tell set targetapp to "OmniOutliner Professional" tell application "System Events" to set rr to name of the processes if targetapp is not in rr then tell application targetapp to activate tell application "System Events" to set rr to name of the processes end if set rr1 to rr repeat until rr1 ­ rr and targetapp is not in rr1 tell application "System Events" to set rr1 to name of the processes do shell script "sleep 2" end repeat beep do shell script "rsync -tru local/path/to/file/kgtd.oo3/ username@remote.host:'remote/path/to/file/kgtd.oo3/'" do shell script "rsync -tru local/path/to/file/kgtd.oo3/ username@remote.host:'remote/path/to/backup/directory/kgtd.oo3/'" beep