Possible race condition with TypeText and next script step

Hello all,

When I run the script below, things seem to work except where TypeText comes in. It seems that the next step is executed BEFORE the TypeText step executes, and so it fails with an invalid password error.

DoubleClick “installers.zip”
Click “desktop”
DoubleClick “Installers Folder”
DoubleClick “console.pkg”
Click “Continue button”
if imagefound(“Install for all click.tiff”) then
Click “Install for all click”
Click “Continue button”
Click “install button”
Click “install button”
end if
TypeText “password”
Click “OK button”
Click “Close button”

I have gone in and set my mouse click delay to .05 seconds, but this seems to not have resolved the problem.

Has anyone any advice?

Thanks for any and all assistance.


Steve O’Sullivan

Perhaps the system needs some extra time to process the previous commands before it can accept the TypeText command. Try inputting a WaitFor statement before your TypeText command to see if that helps.

WaitFor 8 seconds, "image_of_password_label"

TypeText "password"

I think EPJoK is right and that you’ve begun typing before the password field is ready to receive the input. Another question: Is the cursor automatically placed in the password field? There’s no click or anything to put the focus on the field before you type the password; that would be a problem in some instances–the typetext would be executed but the characters would just be sent into the void.

BTW, I’d go back into the preferences and restore the defaults; I don’t think the change you made to the Mouse Click Delay was significant, but I’d hate for it to lead to some unforeseen side effect later when everyone has forgotten that you’ve changed it.