Script works on one Mac but not on another... Can anyone solve this?

I wrote some scripts on a PowerMac G5 PPC Dual 1.8 running OSX 10.5.8.

I have moved them to a MacMini G4 PPC 1.5 also running OSX 10.5.8… but they fail.

Both computers are running Safari 5.0.6. Can anyone shed any light on this? I am totally stumped.

This is the line of script in question and the error I receive is below:

on SafariWindowHasLoaded(inWindowIndex)
tell application “System Events” to ¬
tell application process “Safari”
set theStatusText to name of static text 1 of group 1 of window inWindowIndex as text
if theStatusText begins with “Contacting” or ¬
theStatusText begins with “Loading” or ¬
theStatusText begins with “Waiting” then
set theReturnValue to false
else
set theReturnValue to true
end if
end tell
return theReturnValue
end SafariWindowHasLoaded

ERROR:

System Events got an error: Can’t get static text 1 of group 1 of window 1 of application process “Safari”. Invalid index.

Hello.

I just wonder if the same things are enabled in both browsers, The toolbar line, the bookark line, etc.

It may seem that there is such differences, and those differences will enumerate the ui-elements differently.

I hope this helps. :slight_smile:

Superb suggestion!

I had hide status bar enabled - that was the problem.

Thanks very much for your help.