Password text field filling issue with (set value to variable_name)

Hi,

I was able to bring up a window for “MyApplication1” and fill some text fields.

But, for the password field (text field 3 of group 1 of tab group 1 of window 1), somehow I cannot fill it.

In the previous block of my AppleScript, I already defined user_username and user_password.

If I try some text statement like “keystroke user_password”, it seems to enter it there, so it’s not the the problem with the value of user_password.

Anyone know the possible reason and the resolution?

Thanks!

  • Life Learner

tell application “System Events” to tell process “MyApplication1”
delay 1
click menu bar item 1 of menu bar 2
click
click menu item “Show Panel” of menu 1 of menu bar item 1 of menu bar 2
delay 1
tell text field 1 of group 1 of tab group 1 of window 1
set value to user_username
end tell
delay 1
tell text field 3 of group 1 of tab group 1 of window 1
set value to user_password
end tell

delay 1
tell checkbox 1 of group 1 of tab group 1 of window 1
if not (its value as boolean) then click
end tell
tell text field 2 of group 1 of tab group 1 of window 1
set value to “portal.mycompany.com
end tell
delay 1
click button 1 of group 1 of tab group 1 of window 1
delay 1
click button 1 of window 1
end tell

Also, for the same code, it takes a long time until the window pops up after clicking on the menu bar item.

tell application “System Events” to tell process “MyApplication1”
delay 1
click menu bar item 1 of menu bar 2
click

Could someone with expertise please help me?

Thanks so much in advance!

  • Life Learner

May you try to replace the instruction :
delay 1
by
set frontmost to true

Yvan KOENIG (VALLAURIS, France) mardi 26 mai 2015 20:39:54

Hi Yvan,

I tried it but got the same result, still taking several seconds.

Thanks.

  • Life Learner

Sorry, regarding my original issue of not being able to fill the password field, it turns out my bad.

I had to get the user_password variable correctly in the previous block of my code, which I didn’t include in my posting.

But, my 2nd issue (delay after clicking on the menu bar icon) is an issue that I’m having with and don’t know how to resolve it.

Maybe I’ll post it under the correct subject later.

Thank you.

  • Life Learner

Hi lifelearner,

I don’t have an answer but what kind of application are you using?

Later,
kel