Launch Security Agent does not work o certain machines

I am running this script on Tiger OS. I am trying to run the same script on multiple machines with the same OS.
I have this script which seems to work fie for some machines but fails on some.

ignoring application responses
	launch application "dir:dir:FileMaker Pro 10.app"
end ignoring
delay 10
tell application "System Events"
	delay 10
	tell application process "SecurityAgent"
		activate
		set value of attribute "AXValue" of text field 1 of group 1 of window 1 to "king"
		set value of attribute "AXValue" of text field 2 of group 1 of window 1 to "king1"
		click button "OK" of group 2 of window 1
	end tell
end tell

On some machines, it does ot enter the login and password, it basically does not recognize the Security Agent Window and fails to activate it. I get the Object not found error and it bails out.
I need the same change to work on all my machines.

Hi,

GUI scripting is always time critical.
Use a wait loop until a certain UI element exists, it’s much better than a random delay,
something like this


.
tell application "System Events"
	repeat until (exists window "Authenticate" of process "SecurityAgent")
		delay 0.5
	end repeat
	tell window "Authenticate" of process "SecurityAgent"
		tell group 1
			set value of text field 1 to "king"
			set value of text field 2 to "king1"
		end tell
		click button "OK" of group 2
	end tell
end tell
.

btw: You’re posting into the OS 9 forum :wink: