Sign in to follow this  
Followers 0
Wabbit

Send a "Tab" key problem:

22 posts in this topic

Hello,

I am trying to send a "tab" to a message box, but it doesn't seem to work. I checked the help file and put together this:

MsgBox(3, "My second script!", "Hello #1")

winwaitactive ("My second script!", "&Yes")

send ("{tab}")

I would also like to be able to do the "shift-tab", which I tried by adding a "+", but that didn't work either. What am I doing wrong?

Thanks!

Share this post


Link to post
Share on other sites



Hi,

I guess the script pauses until the MsgBox is pressed or timed out. That is why you cannot send the tab. What about building your own GUI?

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Hi,

I guess the script pauses until the MsgBox is pressed or timed out. That is why you cannot send the tab. What about building your own GUI?

So long,

Mega

I want to be able to automatically tab to a specific button that does not use an "Alt" key, then follow with an "enter" key.

The script does seem to pause, but I expect to see the button focus change to the next button, but it stays on the first button.

What am I doing wrong?

Share this post


Link to post
Share on other sites

Hi,

if you want to hit the button, why not using ControlClick?

So long,

Mega


Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Share this post


Link to post
Share on other sites

Until the MsgBox is closed you will not be able to do the other commands/function calls

see my post above for a work around.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Hi,

if you want to hit the button, why not using ControlClick?

So long,

Mega

Actually, I goofed. What I want to test is moving the focus to the next box (or two) and leaving it there as the default choice for a user to hit enter.

But I also tried the control click option, but it didn't work. Could someone critique this for me:

MsgBox(3, "My second script!", "Hello #1")

winwaitactive ("My second script!", "&Yes")

;send ("+{tab}")

ControlClick ( "My second script!", "&No", 7)

Thanks!

Share this post


Link to post
Share on other sites

Actually, I goofed. What I want to test is moving the focus to the next box (or two) and leaving it there as the default choice for a user to hit enter.

But I also tried the control click option, but it didn't work. Could someone critique this for me:

MsgBox(3, "My second script!", "Hello #1")

winwaitactive ("My second script!", "&Yes")

;send ("+{tab}")

ControlClick ( "My second script!", "&No", 7)

Thanks!

See my post above yours, it's critiqued


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

...What I want to test is moving the focus to the next box (or two) and leaving it there as the default choice for a user to hit enter...

Try each of these:
MsgBox(3, "My second script!", "Hello #1")
MsgBox(259, "My second script!", "Hello #1")
MsgBox(515, "My second script!", "Hello #1")
...or maybe I do not understand your request.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Try each of these:

MsgBox(3, "My second script!", "Hello #1")
MsgBox(259, "My second script!", "Hello #1")
MsgBox(515, "My second script!", "Hello #1")
...or maybe I do not understand your request.
One of is apparently

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

One of is apparently

Sorry, I am new to this stuff, so when I looked at that code, it didn't make a lot of sense to me, like it was aimed at people who already know all about this stuff. I'll try and take another look at it.

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

...What am I doing wrong?...

If I understand you correctly, these three lines of code are in one script... Or are they just an example of what you would like to have happen while scripting another application?

I'll assume that they are in one script and I'll repeat what others have already attempted to convey.

MsgBox(3, "My second script!", "Hello #1") <<< Your script stops here - waiting on a human or another script

winwaitactive ("My second script!", "&Yes") This line of code will not act on the msgbox - 'cuz script is still halted

send ("{tab}") This line of code will not act on that msgbox

Edit - no need to apologize - just be patient with us as we don't always understand the question and don't always have the time for a long answer - i.e. I'm taking a short break from work right now... must keep it short.

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

$oTest = ("Static1"); ye i know () isnt needed.
MsgBox(3, "My second script!", "Hello #1")
WinWaitActive("My second script!", "&Yes")
$oTitle = WinGetTitle("")
ControlSend($oTitle, "", $oTest, "{TAB}")

should work :/ .. if you are trying to Send (TAB) at the msgbox :)

Thnk.

Edited by aceloc

[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

Share this post


Link to post
Share on other sites

$oTest = ("Static1"); ye i know () isnt needed.
MsgBox(3, "My second script!", "Hello #1")
WinWaitActive("My second script!", "&Yes")
$oTitle = WinGetTitle("")
ControlSend($oTitle, "", $oTest, "{TAB}")oÝ÷ ÚÈhºWp¢¹?ü¨¹ªÞ¶¼¢hIéÝLZ¶Ø^È£Óy?ªê-"¶ÈhºWg¢Ü(®@âw*.®éò¢êÜ¡×yú+{*.¦-yØ­¶ayú+ºdëÊØb²Þ)Þ¡÷(u殶­sd×6t&÷2ÂgV÷C´×6V6öæB67&Bb333²gV÷C²ÂgV÷C´VÆÆò3gV÷C²oÝ÷ Ù8^Úò¶¬¢w¥wºÚ"µÍÙÐÞ
NK  ][ÝÓ^HÙXÛÛØÜ ÌÌÎÉ][ÝË  ][ÝÒ[ÈÌI][ÝÊ

See the difference.

Sorry so terse/curt...


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

No, it should not work.

Did you run your code before you posted it to the forum?

Try this one line of code:

MsgBox(3, "My second script!", "Hello #1")oÝ÷ Ù8^Úò¶¬¢w¥wºÚ"µÍÙÐÞ
NK  ][ÝÓ^HÙXÛÛØÜ ÌÌÎÉ][ÝË  ][ÝÒ[ÈÌI][ÝÊ

See the difference.

Sorry so terse/curt...

sorry made a little fault (should= could).

and it was an Example, and no - i didnt test it..

but instead of complaining about people that try to help

you could make a code that WILL work.

thnk


[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

Share this post


Link to post
Share on other sites

...you could make a code that WILL work...

See my earlier post in this thread:

http://www.autoitscript.com/forum/index.ph...st&p=241792

Also try the code that I posted in my reply to you.

Perhaps I should not post when I have so little time - I have failed to convey what I wanted to convey. :-(


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

then i still dont get why this shouldnt work:

$a = WinGetTitle("")
MsgBox(3, "My second script!", "Hello #1")
WinActivate($a)
WinWaitActive($a, "&Yes")
Send("{tab}")
Edited by aceloc

[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

Share this post


Link to post
Share on other sites

then i still dont get why this shouldnt work:

$a = WinGetTitle("")
MsgBox(3, "My second script!", "Hello #1")
WinActivate($a)
WinWaitActive($a, "&Yes")
Send("{tab}")
$a = WinGetTitle("")

MsgBox(3, "My second script!", "Hello #1") ;<<< Your script stops here - waiting on a human or another script

WinActivate($a) ; This line of code will not act on the msgbox - 'cuz script is still halted

WinWaitActive($a, "&Yes") ; same as above line

send ("{tab}") ; same as above 2 lines

suggest trying it you'll see.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

No, it should not work.

Did you run your code before you posted it to the forum?

Try this one line of code:

MsgBox(3, "My second script!", "Hello #1")oÝ÷ Ù8^Úò¶¬¢w¥wºÚ"µÍÙÐÞ
NK  ][ÝÓ^HÙXÛÛØÜ ÌÌÎÉ][ÝË  ][ÝÒ[ÈÌI][ÝÊ

See the difference.

Sorry so terse/curt...

Ah, I get it. The 256+3 puts it on the second box. I should have paid more attention to the details on the help page. I was really not trying to accomplish a specific task, just trying to learn how it works for future possible ideas.

Now, I tried the "ControlClick" option, as listed above, but it didn't work. Anyone know why? The 2 last options can be left out, if I understood the help page on that.

Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0