Post

Replies

Boosts

Views

Activity

Reply to My .scpt script fail sometimes
We execute the script via SSH with osascript "name of script.scpt" Consider that the script it works. This is the script .scpt that we call: set usr to (do shell script "echo $USR") set pwd to (do shell script "echo $PWWD") set maxRetries to 3 set attempt to 0 set loginSuccess to false set statusFile to "/Users/digicertusr/Downloads/success.txt" repeat while (attempt < maxRetries and loginSuccess is false) set attempt to attempt + 1 tell application "Safari" activate open location "https://xxxxxx.com" end tell delay 5 tell application "System Events" keystroke usr delay 5 keystroke tab delay 3 keystroke pwd delay 5 keystroke return end tell tell application "Safari" activate open location "https://www.wikipedia.org" end tell delay 5 tell application "Safari" set pageTitle to name of front document end tell if pageTitle contains "Wikipedia" or pageTitle contains "Sign On" or pageTitle contains "xxxxxxxxxx" then set loginSuccess to true else set loginSuccess to false end if tell application "Safari" close front window quit end tell end repeat if loginSuccess is false then do shell script "echo 'FAILED' >> /Users/digicertusr/Downloads/failed.log" end if Thanks
5d