Clear GUI memory

Share your favorite FastKeys commands
Post Reply
ThiasEsseboom
Posts: 8
Joined: Nov 7th, ’22, 16:03

Post by ThiasEsseboom » Apr 7th, ’23, 12:48

Hi there! It's me again ;-)

Due to an issue with FastKeys automatically sending Send messages in all capitals, I'm rebuilding the Start Menu items to work as Commands, as it doesn't have the issue then.

However, now I'm having the issue, that I can't use the %INPUT_Name% functionality, so I have to build GUIs which is fine as well, but after using one GUI, it keeps sending the same message, even though the message is different.

The first code I use is:

Code: Select all

Gui, Add, Text,, Name
Gui, Add, Edit, vFirstName ym
Gui, Add, Button, default, OK  
Gui, Show,, Welcome
return

GuiClose:
ButtonOK:
Gui, Submit
Send, Hi %FirstName% :-) Thank you for contacting liveChat. My name is %A_Name%, and I'll be assisting you today. {Enter}
Gui, Destroy


This works fine, and gives me the output: Hi Thias :-) Thank you for contacting liveChat. My name is Thias, and I'll be assisting you today.

However, the next GUI is for when people need to contact us via email, I use the following code:

Code: Select all

Gui, New,,Email
Gui, Add, Text,, Select Email
Gui, Add, DropDownList, vEmailFront ym, support|service|help
Gui, Add, DropDownList, vEmailBack, 1.com|2.com|3.com
Gui, Add, Button, default, OK  
Gui, Show,,
return

GuiClose:
ButtonOK:
Gui, Submit
Send, Please contact us via email on %EmailFront%@%EmailBack%, using the email address you've registered with. {Enter}
Gui, Destroy
ExitApp
This gives me the output: Hi :-) Thank you for contacting liveChat. My name is Thias, and I'll be assisting you today.

So I need to have the GUI forget what was on the Send command somehow, so it will send the correct message, which would be "Please contact us via email on [email protected], using the email address you've registered with.

Is there a way to do this?
User avatar
Marko
Posts: 1719
Joined: Mar 2nd, ’13, 21:02

Post by Marko » Apr 8th, ’23, 09:28

You need to rename the second subroutine ButtonOK.

Code: Select all

Gui, 2:Add, Text,, Select Email
Gui, 2:Add, DropDownList, vEmailFront ym choose1, support|service|help
Gui, 2:Add, DropDownList, vEmailBack choose1, 1.com|2.com|3.com
Gui, 2:Add, Button, default gButtonOK2, OK 
Gui, 2:Show
return

ButtonOK2:
Gui, 2:Submit
SendInput, Please contact us via email on %EmailFront%@%EmailBack%, using the email address you've registered with. {Enter}
Gui, 2:Destroy
Return

2GuiEscape:
2GuiClose:
Gui, 2:Destroy
return
Post Reply