FredSmith1966 Posted October 6, 2006 Share Posted October 6, 2006 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 More sharing options...
this-is-me Posted October 6, 2006 Share Posted October 6, 2006 Why not use Send("+{ENTER}") ? Who else would I be? Link to comment Share on other sites More sharing options...
Golbez Posted October 6, 2006 Share Posted October 6, 2006 Send("{SHIFT DOWN}{ENTER}{SHIFT UP}",0) its like this anyway Link to comment Share on other sites More sharing options...
this-is-me Posted October 6, 2006 Share Posted October 6, 2006 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? Link to comment Share on other sites More sharing options...
FredSmith1966 Posted October 6, 2006 Author Share Posted October 6, 2006 Why not use Send("+{ENTER}") ?I have tried Send("+{ENTER}") also. Still same problem, the SHIFT appears to get lost! Link to comment Share on other sites More sharing options...
this-is-me Posted October 6, 2006 Share Posted October 6, 2006 Have you tried it without the 0 flag on send? Who else would I be? Link to comment Share on other sites More sharing options...
FredSmith1966 Posted October 6, 2006 Author Share Posted October 6, 2006 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 More sharing options...
Xenobiologist Posted October 6, 2006 Share Posted October 6, 2006 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 More sharing options...
this-is-me Posted October 7, 2006 Share Posted October 7, 2006 (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 October 7, 2006 by this-is-me Who else would I be? Link to comment Share on other sites More sharing options...
FredSmith1966 Posted October 8, 2006 Author Share Posted October 8, 2006 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! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now