First of all, thanks Shane; all read & writes changed to ‘current application'. I fixed my problem by ensuring I read the file as a list, and then checking for a count of zero.
This next hassle has me beat. A script (which forms part of my Xcode project) was working a week ago, but has now suddenly stopped, with an error of…
I’ve tried several changes, but the script won’t get past the indicated line. I’ve double checked with UI Browser, and the details still are the same.
tell application "Interarchy"
activate
do shell script ("sleep 0.4")
tell application "System Events" to tell process "Interarchy"
do shell script ("sleep 0.4")
click menu item "Show All Bookmarks" of menu 1 of menu bar item "Bookmarks" of menu bar 1
do shell script ("sleep 0.4")
repeat with eachRow from 1 to (count of rows of outline 1 of scroll area 1 of UI element 1 of UI element 1 of UI element 2 of UI element 7 of window "Bookmarks")
do shell script ("sleep 0.4")
select row eachRow of outline 1 of scroll area 1 of UI element 1 of UI element 1 of UI element 2 of UI element 7 of window "Bookmarks"
do shell script ("sleep 0.2")
set windowName to value of static text 1 of group 1 of row eachRow of outline 1 of scroll area 1 of UI element 1 of UI element 1 of UI element 2 of UI element 7 of window "Bookmarks"
keystroke "j" using command down
set x to 0
do shell script ("sleep 0.6")
# set focused of pop up button 1 of UI element 1 of UI element 2 of UI element 1 of scroll area 1 of UI element 2 of UI element 7 of window windowName to true
# This was working, but suddenly stopped.
click pop up button 1 of UI element 1 of UI element 2 of UI element 1 of scroll area 1 of UI element 2 of UI element 7 of window 1 #windowName
set x to 0
repeat until exists menu 1 of pop up button 1 of UI element 1 of UI element 2 of UI element 1 of scroll area 1 of UI element 2 of UI element 7 of window windowName
do shell script ("sleep 0.1")
set x to x + 1
if x > 20 then exit repeat
end repeat
if my saveLocalftpArchiveOnserver then
click menu item "Both Ways" of menu 1 of pop up button 1 of UI element 1 of UI element 2 of UI element 1 of scroll area 1 of UI element 2 of UI element 7 of window windowName
else
click menu item "Download" of menu 1 of pop up button 1 of UI element 1 of UI element 2 of UI element 1 of scroll area 1 of UI element 2 of UI element 7 of window windowName
end if
try
tell window windowName to activate
end try
keystroke return
set x to 0
repeat until exists window "Bookmarks"
do shell script ("sleep 0.1")
set x to x + 1
if x > 600 then exit repeat
end repeat
end repeat
click button 3 of window "Bookmarks"
delay 0.2
try
click button 3 of window 1
end try
end tell
end tell