Sign in to follow this  
Followers 0
FredSmith1966

Problems with Send("{SHIFTDOWN}{ENTER}{SHIFTUP}")

10 posts in this topic

I have used SciTE script writer to record a script where I run a program from Start>Run but need to press SHIFT+ENTER (or using the mouse SHIFT + Click on OK) to get the application to popup another dialogue box.

ScriptWriter recorded Send("{SHIFTDOWN}{ENTER}{SHIFTUP}") which is what I expected.

When I run the script, it only appears to send just the ENTER key as the extra dialogue box does not popup

I have experimented with changing SendKeyDownDelay up to 1000 but no luck.

Here is the problem part of my script:

Send("#r")

WinWait("Run","")

If Not WinActive("Run","") Then WinActivate("Run","")

WinWaitActive("Run","")

Send("R:\datawrks\datawrks.exe")

sleep(1000)

Opt("SendKeyDownDelay", 100)

Send("{SHIFTDOWN}{ENTER}{SHIFTUP}",0)

Share this post


Link to post
Share on other sites



Why not use Send("+{ENTER}") ?


Who else would I be?

Share this post


Link to post
Share on other sites

Send("{SHIFT DOWN}{ENTER}{SHIFT UP}",0)

its like this anyway

Share this post


Link to post
Share on other sites

Golbez, You know not of what you speak. The helpfile clearly states (and I quote)

{SHIFTDOWN} Holds the SHIFT key down until {SHIFTUP} is sent


Who else would I be?

Share this post


Link to post
Share on other sites

Why not use Send("+{ENTER}") ?

I have tried Send("+{ENTER}") also. Still same problem, the SHIFT appears to get lost!

Share this post


Link to post
Share on other sites

Have you tried it without the 0 flag on send?


Who else would I be?

Share this post


Link to post
Share on other sites

Have you tried it without the 0 flag on send?

I have tried the following:

Send("{SHIFTDOWN}{ENTER}{SHIFTUP}",0)

Send("{SHIFTDOWN}{ENTER}{SHIFTUP}")

Send("+{ENTER})

Send("R:\datawrks\datawrks.exe{SHIFTDOWN}{ENTER}{SHIFTUP}",0)

Send("R:\datawrks\datawrks.exe+{ENTER}",0)

Being a newcomer to AutoIT, are there any issues with specific keybord drivers etc. that could cause my problem? I have not had the opportunity to test this on another machine at this stage.

Share this post


Link to post
Share on other sites

Hi,

try this on different programs.

HotKeySet("1", "a")

While 1
    Sleep(1000)
WEnd

Func a()
    Send("+{ENTER}")
EndFunc   ;==>a

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

#9 ·  Posted (edited)

I think I can guess the issue here. Try this:

Send("{SHIFTDOWN}{ENTER}")
Sleep(10000)
Send("{SHIFTUP}")oÝ÷ Ù8b²ÇËhmëaz趦ÛüاÚ*ºlyꮢÛazÈb~ÙÊz-¶«ºvèÅ8^­çè­ì¨º¯zÚ$yêjºa¢Wb
®¢Û!ûnØ¥¶¥jéÜçZ¦bq«b¢vqêm²Ø^r¦jw@Ê2¢çÚ-çèZ0xºÚ"µÍ[  ][ÝÔÌLÙ]]ÜÜÉÌLÙ]]ÜÜË^I][ÝÊ

instead of coming from the run box.

Edited by this-is-me

Who else would I be?

Share this post


Link to post
Share on other sites

This seems to be the program itself wanting to "see" the shift key, not the run box. Therefore, you have to keep "holding" shift until the launched application accepts the command.

You are right.

Here is my working code:

Send("{SHIFTDOWN}",0)

Sleep(100)

Send("{ENTER}", 0)

Sleep(1000)

send("{SHIFTUP}", 0)

Thank You all, I am now a happy little vegemite! :lmao:

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