Send Complete then MsgBox

Get help with using AutoHotkey and its commands and hotkeys
User avatar
SubLime
Posts: 2
Joined: 10 Nov 2017, 19:34

Send Complete then MsgBox

10 Nov 2017, 19:47

So, I know this must be a simple question, but for the life of me I can't seem to get it working and my Google-fu is failing me after 6 on a Friday...

I've got the code below running, plugging in variables based on user input in a GUI. The problem is that the user input could be extremely long or super short, there's no way to know. I want to make the content from the user input completely send into the field in my tool before having a MsgBox pop up saying the automation has completed and for them to take the next action which will be manual. In the past I've just used "Sleep x" to provide a needed gap between Send commands and following commands, but since the amount of text being sent varies so drastically I don't think that's a reasonable solution. Any ideas?

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

User avatar
divanebaba
Posts: 202
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: Send Complete then MsgBox

10 Nov 2017, 21:44

SubLime wrote:Any ideas?

I can`t see any field of your tool or its name.
If you want to speed up, use everytime sendinput instead of send command.
Another way, to speed up, is to store the content into clipboard and sending from there.
For more support more information is needed, like:
- what kind of document is used?
- is it an Excel sheet or a formular on a website?
- is your tool coded in AHK?

Most reliable commands to fill controls, like Edit, ComboBox and so on, are following commands:
GuiControl, ControlSetText, ControlSend and surely some more.
Check them out for superior speed and most reliability for transfering data even to non-AHK controls.


[Starklichtbirne IQ >> 250!!] Dank deutscher Lehrerempfehlung, nur Superdepp und Hartz4-Bezieher, statt Abiturient und Einkommensbezieher.
[Strong light bulb IQ >> 250!!] Thanks to german teacher's recommendation, willful and welfare recipient, instead of high school graduate and moneymaker.

Entering high school for foreign children is not prohibited in GERMANY, it's only made nearly impossible by government.
Virtually the only way - visiting high school abroad.
User avatar
SubLime
Posts: 2
Joined: 10 Nov 2017, 19:34

Re: Send Complete then MsgBox

14 Nov 2017, 10:24

So, to clarify further, my entire tool is coded in AHK, gui and all. I only quoted the relevant code as the preceding code has a lot to do with defining the look and functionality of the gui.

The hotkey functions by creating a GUI for user input which then triggers a command to open a suggestion box webform and send the user input and some automatic fields into the webform. Due to security restrictions, I cannot directly access the webform so I'm creating an instance of IE and sending the content to the form that way. The issue I was running into is that the user input varies pretty wildly in length and the send command (or sendinput, which I have "SendMode Input" at the top of my code by default) wasn't finishing before my MsgBox was triggering with the prompt for the user to attach documentation. The MsgBox was stopping the send command midway through its task.

divanebaba wrote:Another way, to speed up, is to store the content into clipboard and sending from there.


I hadn't thought to use the clipboard and this seems to be working. Thanks!
User avatar
divanebaba
Posts: 202
Joined: 20 Dec 2016, 03:53
Location: Diaspora

Re: Send Complete then MsgBox

20 Nov 2017, 04:01

divanebaba wrote:Most reliable commands to fill controls, like Edit, ComboBox and so on, are following commands:
GuiControl, ControlSetText, ControlSend and surely some more.
Check them out for superior speed and most reliability for transfering data even to non-AHK controls.
Whatever you're clicking, reliablest way to send and retrieve data from foreign controls are the commands, beginning with control..., like ControlClick, ControlSend etc..
Try to find out the names of the foreign controls by using "Window Spy".


[Starklichtbirne IQ >> 250!!] Dank deutscher Lehrerempfehlung, nur Superdepp und Hartz4-Bezieher, statt Abiturient und Einkommensbezieher.
[Strong light bulb IQ >> 250!!] Thanks to german teacher's recommendation, willful and welfare recipient, instead of high school graduate and moneymaker.

Entering high school for foreign children is not prohibited in GERMANY, it's only made nearly impossible by government.
Virtually the only way - visiting high school abroad.

Return to “Ask For Help”

Who is online

Users browsing this forum: AutohotkeyAHK, Birdy905, sqlcode and 44 guests