Jump to content

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


Recommended Posts

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)

Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

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?
Link to comment
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:

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...