Cedeq Community Forum
How to put a delay - Printable Version

+- Cedeq Community Forum (https://cedeq.com/forums)
+-- Forum: General (https://cedeq.com/forums/forumdisplay.php?fid=1)
+--- Forum: Need help with ShortKeeper? (https://cedeq.com/forums/forumdisplay.php?fid=2)
+--- Thread: How to put a delay (/showthread.php?tid=34)



How to put a delay - Philippe27 - 03-26-2018

One of my shortcut is to enter my username then my password and then press enter all in one. The problem is the enter is too quick and sometimes my password is not completed before the enter occures. It leads to an error and I have to do it all over again. Is there a way to have a delay between the end of the password and the enter?


RE: Error with "Enter" - Bianka_2726 - 03-27-2018

I know you can do it with Autohotkey programmation. I am not an expert with AHK but you can put a delay between your password and your enter command with a sleep. Maybe someone can tell you how to write it down in the Run AutoHotkey code section in Shortkeeper!


RE: How to put a delay - denilama - 04-05-2018

Based on the information above, I would create a shortcut with the "Run AutoHotkey code" command in ShortKeeper (instead of the "Insert text" command) using the following code:

Need help creating a keyboard shortcut with ShortKeeper using the following AutoHotkey code? This 5-minute tutorial will help!
SendInput {raw}
(
Username Password
)
Sleep 1000
SendInput {enter}

The script presupposes a tab separating the Username and Password (line #3), and a 1-second delay between the Password and Enter (Sleep 1000 at line #5). If you need 2 seconds, just change this to Sleep 2000.

Keep in mind that this short code is not especially reliable. The "Enter" won’t work if the webpage takes more than one second (or two) to open.

If you could let me know the URL of the login page, I could come up with something a lot more reliable (like this script).


RE: How to put a delay - Philippe27 - 04-12-2018

Hi Denilama! First thank you for your time and advice. The URL of the login page is : https://login.questrade.com/Signin.aspx. I can't wait to see the best way to make it work! Thanks again!


RE: How to put a delay - denilama - 04-13-2018

This AutoHotkey script should do the work (YourUsername and YourPassword must be set at lines #1 and #2) (Do not remove quotation marks).:

Need help creating a keyboard shortcut with ShortKeeper using the following AutoHotkey code? This 5-minute tutorial will help!
Username := "YourUserName"
Password := "YourPassword"
URL := "https://login.questrade.com/Signin.aspx"
wb := ComObjCreate("InternetExplorer.Application")
wb.Visible := True
wb.Navigate(URL)
While wb.readyState != 4 || wb.document.readyState != "complete" || wb.busy ; wait for the page to load
  Sleep, 100
wb.document.getElementById("ctl00_DefaultContent_txtUsername").value := Username
wb.document.getElementById("ctl00_DefaultContent_txtPassword").value := Password
wb.document.getElementById("ctl00_DefaultContent_btnLogin").Click()

This script will also work if you are already logged into Questrade. It will start Internet Explorer even if this is not your default browser. The script was tested with Windows 7 and 10.

If Questrade changes the way its web page works, this script might stop working. If you experience any problems, kindly let us know with a post on this thread. You can subscribe to the thread to be notified of any updates.


RE: How to put a delay - Philippe27 - 04-17-2018

Thank you so much Denilama! It works perfectly.