Search found 34 matches

by slishnevsky
20 May 2024, 13:28
Forum: Ask for Help (v2)
Topic: Get and set caret (cursor) position (focus?)
Replies: 1
Views: 140

Get and set caret (cursor) position (focus?)

Hello. A simple question. I put a cursor in a specific position (a field). After AHK script starts running, at some point the position (focus?) is lost due to the way the website is constructed. Is there any way to remember the original cursor (caret) position, so that I can restore when the script ...
by slishnevsky
18 May 2024, 12:02
Forum: Ask for Help (v2)
Topic: Get and set caret cursor position?
Replies: 2
Views: 204

Re: Get and set caret cursor position?

This is the scenario...
image.png
image.png (73.59 KiB) Viewed 200 times
Before sending a text, I display a popup message using Gui.
Even if I don't display a message, the focus is going away often
How can I put a cursor back, so that I can send a text?
by slishnevsky
18 May 2024, 11:58
Forum: Ask for Help (v2)
Topic: Get and set caret cursor position?
Replies: 2
Views: 204

Get and set caret cursor position?

I am talking about a keyboard, not a mouse.

Is there any way to get a caret position and then use it to set the cursor in that position before sending text?
by slishnevsky
16 May 2024, 08:43
Forum: Ask for Help (v2)
Topic: Why color is not displayed correctly?
Replies: 2
Views: 116

Re: Why color is not displayed correctly?

Oh, true.
I forgot about the stay parameter, missed it. My fault. Thank you!

The stay parameter is actually redundant, I planned to remove it, but forgot :)
by slishnevsky
16 May 2024, 06:00
Forum: Ask for Help (v2)
Topic: Why color is not displayed correctly?
Replies: 2
Views: 116

Why color is not displayed correctly?

Color_Primary := "5573B5" Color_Danger := "BE5A52" Color_Success := "7CBB5F" ; ------------------------------------------------------------------------------- ; ShowMessageBox ; ------------------------------------------------------------------------------- ShowMessageBox(message, stay := 0, color ...
by slishnevsky
11 May 2024, 19:10
Forum: Ask for Help (v2)
Topic: How to Send text as one string?
Replies: 6
Views: 473

How to Send text as one string?

Hello.

I was playing with the Send command.
It seems it can only send text character by character, like typing.
I was wondering if it is possible to send a text as a whole string?

Thanks.
by slishnevsky
09 May 2024, 04:27
Forum: Ask for Help (v2)
Topic: How to define an action if any typing key is pressed?
Replies: 2
Views: 144

How to define an action if any typing key is pressed?

How to define an action if any typing key is pressed?
By typing key I mean letters, numbers, special characters like quotes, #, $, % etc...?
I want to use #Hot syntax to catch only these characters.
Thanks
by slishnevsky
29 Apr 2024, 13:40
Forum: Ask for Help (v2)
Topic: Send vs SendText vs SendInput for text input?
Replies: 2
Views: 412

Send vs SendText vs SendInput for text input?

Hi. I couldn't understand from the documentation which is the best method to send text into text field in terms of speed? When I do this in Twitter reply, any of these methods work quite slow and part-by-part for just one sentence. It takes about 2-3 seconds to send text into the input field. Why is...
by slishnevsky
15 Apr 2024, 13:31
Forum: Ask for Help (v2)
Topic: ListBox Enter pressed event?
Replies: 8
Views: 270

ListBox Enter pressed event?

Hello. Is there an Enter pressed event for ListBox in AHK 2? Let's say I selected an item in ListBox, and I want to submit it by pressing Enter key? Is it possible, like using OnEvent() method for example? Something like MyListBox.OnEvent('Enter', EnterPressed) I know there is no "Enter" event for L...
by slishnevsky
12 Apr 2024, 18:09
Forum: Ask for Help (v2)
Topic: Ho to get a value of ListBox1 control here?
Replies: 6
Views: 143

How to get a value of ListBox1 control here (conitnue)?

This is a continuation of my previous thread [Moderator note: Now the same thread.] Still struggling with passing a value selected in the ListBox back to the Hotkey code, the result variable. So I have a ButtonClicked event handler, fine, not sure if it is needed at all. In the Hotkey code I show th...
by slishnevsky
12 Apr 2024, 16:24
Forum: Ask for Help (v2)
Topic: Ho to get a value of ListBox1 control here?
Replies: 6
Views: 143

Re: Ho to get a value of ListBox1 control here?

flyingDman Cool. Thanks !! Can I do this inline, without external click event handler function? I need ListBoxGetChoice() function to return ListBox1 selected option when I click Submit button. Something like this: Ins:: result := ListBoxGetChoice() ; Ins Hotkey to call a function that displays a p...
by slishnevsky
12 Apr 2024, 16:08
Forum: Ask for Help (v2)
Topic: Ho to get a value of ListBox1 control here?
Replies: 6
Views: 143

Ho to get a value of ListBox1 control here?

Hello. How to get a value of ListBox1 control here? Thanks. Home:: { MyGui := Gui('AlwaysOnTop') MyGui.AddText(, "Select category") ListBox1 := MyGui.AddListBox('r6 vCategoryChoice', ['Option1', 'Option2', 'Option3', 'Option4', 'Option5', 'Option6']) MyBtn1 := MyGui.AddButton('Default w80', 'Submit'...
by slishnevsky
08 Apr 2024, 00:11
Forum: Ask for Help (v2)
Topic: Complaining on "try" statement Topic is solved
Replies: 5
Views: 203

Re: Complaining on "try" statement Topic is solved

@boiler

Yes! Worked. Thank you.
by slishnevsky
07 Apr 2024, 22:48
Forum: Ask for Help (v2)
Topic: Complaining on "try" statement Topic is solved
Replies: 5
Views: 203

Re: Complaining on Try statement Topic is solved

Try is not a valid part of an expression which you are trying to define as part of a fat arrow function. The syntax for that is () => expr , where expr is an expression. Makes sense. Then, how should I stop playing audio there? If I move try SoundPlay('Nonexistent.mp3') outside the arrow function, ...
by slishnevsky
07 Apr 2024, 21:21
Forum: Ask for Help (v2)
Topic: Complaining on "try" statement Topic is solved
Replies: 5
Views: 203

Complaining on "try" statement Topic is solved

Hi. Why is AHK complaining on try statement? CreateTimer() { timeout := InputBox('Set timer interval (in minutes)', 'Timer').Value if (!IsInteger(timeout)) Exit SetTimer(() => ( SoundPlay('WakeUp.mp3') MsgBox('Сработал таймер!', 'Таймер', 'Icon! OK') try SoundPlay('Nonexistent.mp3') ; Complains on t...
by slishnevsky
05 Apr 2024, 08:12
Forum: Ask for Help (v2)
Topic: How to reuse Gui window?
Replies: 7
Views: 263

Re: How to reuse Gui window?

Rohwedder wrote:
05 Apr 2024, 07:40
@slishnevsky
Do you mean with
When I call this function from other places
other scripts that contain a copy of this function?
What? No. One script file, other places in code
by slishnevsky
04 Apr 2024, 17:13
Forum: Ask for Help (v2)
Topic: How to reuse Gui window?
Replies: 7
Views: 263

Re: How to reuse Gui window?

You didn't understand.
Each time I call ShowMessageBox() it will create a new instance.
Take a look, this is a countdown timer:
image.png
image.png (1.58 MiB) Viewed 239 times
by slishnevsky
04 Apr 2024, 13:35
Forum: Ask for Help (v2)
Topic: How to reuse Gui window?
Replies: 7
Views: 263

How to reuse Gui window?

Hello. I have this simple function that creates a Gui window (borderless blue window) that stays visible for 1 second: ShowMessageBox(message, stay := 0) { MyGui := Gui('-ToolWindow +Border -Caption +AlwaysOnTop') MyGui.BackColor := '007ACC' MyGui.SetFont('s30 cWhite', 'Roboto') MyGui.AddText('Cente...
by slishnevsky
29 Mar 2024, 19:59
Forum: Ask for Help (v2)
Topic: Why am I getting this error executing DateDiff function?
Replies: 2
Views: 56

Why am I getting this error executing DateDiff function?

Why am I getting this error executing DateDiff function?

image.png
image.png (39.72 KiB) Viewed 56 times
by slishnevsky
29 Mar 2024, 19:45
Forum: Ask for Help (v2)
Topic: How NOT to display AHK icon on the taskbar when script is running?
Replies: 4
Views: 176

How NOT to display AHK icon on the taskbar when script is running?

How NOT to display AHK icon on the taskbar when script is running? image.png On this screenshot the script is running, and AHK icon is displayed by default in the taskbar, thus intercepting a focus (when you are playing a fullscreen game, for example). Is there any way NOT to display it? Is there an...

Go to advanced search