Search found 28 matches
- 25 Sep 2018, 19:36
- Forum: Ask for Help (v1)
- Topic: Alternatives to a very long sequence of if statements Topic is solved
- Replies: 6
- Views: 1340
Re: Alternatives to a very long sequence of if statements Topic is solved
I do this sort of thing a lot. I tend to use what I call bar-strings, eg "AĀ|aā|...". I use StringSplit to convert this to an array, and it's easy from there. In other cases, where the commands are used less frequently, I make a picklist dialog, so I can see what I'm doing (see attachment). The menu...
- 25 Sep 2018, 18:35
- Forum: Ask for Help (v1)
- Topic: Functions without parenthesis Topic is solved
- Replies: 6
- Views: 1295
Re: Functions without parenthesis Topic is solved
OK. Consider a block including several Send statements, which we decide to change to a call to a function Fsend to send in a different way, or with delays.
So 'send {F3}' needs to be changed to 'Fsend("{F3}")'. Takes some time to change them, and doesn't read anywhere else as well.
So 'send {F3}' needs to be changed to 'Fsend("{F3}")'. Takes some time to change them, and doesn't read anywhere else as well.
- 25 Sep 2018, 05:24
- Forum: Ask for Help (v1)
- Topic: Functions without parenthesis Topic is solved
- Replies: 6
- Views: 1295
Re: Functions without parenthesis Topic is solved
Well, for a start you don't need to remember that the ( can't be preceded by a space.
Seriously though, a few times I've need to replace 'commands' with my own functions (which *use* the command), and found this quite tedious.
Seriously though, a few times I've need to replace 'commands' with my own functions (which *use* the command), and found this quite tedious.
- 24 Sep 2018, 22:00
- Forum: Ask for Help (v1)
- Topic: Sending keys only to a particular window, possibly unfocused Topic is solved
- Replies: 11
- Views: 2375
Re: Sending keys only to a particular window, possibly unfocused Topic is solved
Not happy. I tried this with my app and it was unreliable. I slowed it down with sleeps until it was useless and it was still unreliable with this app. And that was with the app active the whole time. The key sequence was as follows (repeated): - ^C and check clipboard, maybe exit - F3 to copy the c...
- 24 Sep 2018, 20:26
- Forum: Ask for Help (v1)
- Topic: Functions without parenthesis Topic is solved
- Replies: 6
- Views: 1295
Re: Functions without parenthesis Topic is solved
Ahh, I wait with bated breath ...
- 24 Sep 2018, 19:27
- Forum: Ask for Help (v1)
- Topic: Functions without parenthesis Topic is solved
- Replies: 6
- Views: 1295
Functions without parenthesis Topic is solved
Is it possible to have a function (actually a procedure, because the return value is discarded), called without the parentheses, like an inbuilt command or a sub in VBA? So if we have a function Do_things(X, Y) is it possible to call it with "Do_things X, Y". The reason I ask this is that functions ...
- 24 Sep 2018, 18:04
- Forum: Ask for Help (v1)
- Topic: Sending keys only to a particular window, possibly unfocused Topic is solved
- Replies: 11
- Views: 2375
Re: Sending keys only to a particular window, possibly unfocused Topic is solved
Ok, I think we're there. Firstly ahk_parent doesn't make any difference (I'd already tried that). The following code works for me. I was slowed down by the suggested ControlFocus, which should have been ControlGetFocus. WinGet, TgtExe, ProcessName, A ; get process name of active ControlGetFocus Fctr...
- 24 Sep 2018, 04:12
- Forum: Ask for Help (v1)
- Topic: Sending keys only to a particular window, possibly unfocused Topic is solved
- Replies: 11
- Views: 2375
Re: Sending keys only to a particular window, possibly unfocused Topic is solved
No difference. Not surprising really, since I'm using the full name of the process. A
- 24 Sep 2018, 03:43
- Forum: Ask for Help (v1)
- Topic: Sending keys only to a particular window, possibly unfocused Topic is solved
- Replies: 11
- Views: 2375
Re: Sending keys only to a particular window, possibly unfocused Topic is solved
No, fraid not - nothing moves at all. I did some more investigations using the following: WinGet, TgtExe, ProcessName, A ControlSend, , {Down}{Down}, ahk_exe %TgtExe% This works for Notepad, but not for Word (winword.exe) or the keying tool (or my own editor, FWIW). All of them work if I just go: se...
- 24 Sep 2018, 01:21
- Forum: Ask for Help (v1)
- Topic: Sending keys only to a particular window, possibly unfocused Topic is solved
- Replies: 11
- Views: 2375
Re: Sending keys only to a particular window, possibly unfocused Topic is solved
Not really - it requires signing up. Also, it's not that much of an issue. I've noticed that some apps appear to be quite recalcitrant when it comes to AHK. A
- 23 Sep 2018, 19:48
- Forum: Ask for Help (v1)
- Topic: Ctrl+V to grid Topic is solved
- Replies: 3
- Views: 675
Re: Ctrl+V to grid Topic is solved
Urk. I didn't expect *that*.
Thanks, pikers.
Thanks, pikers.
- 23 Sep 2018, 16:25
- Forum: Ask for Help (v1)
- Topic: Sending keys only to a particular window, possibly unfocused Topic is solved
- Replies: 11
- Views: 2375
Re: Sending keys only to a particular window, possibly unfocused Topic is solved
No joy there. I've tried
controlSend, , {Down}{Down}, ahk_exe KeyingTool.exe
and nothing happened, even when the window was active.
Andrew
controlSend, , {Down}{Down}, ahk_exe KeyingTool.exe
and nothing happened, even when the window was active.
Andrew
- 22 Sep 2018, 21:58
- Forum: Ask for Help (v1)
- Topic: Sending keys only to a particular window, possibly unfocused Topic is solved
- Replies: 11
- Views: 2375
Sending keys only to a particular window, possibly unfocused Topic is solved
Is there any way to send key sequences so that they only go to the target (initially active) window, even if this becomes unfocused. See the attachment. I need to run sequences in this grid, but occasionally use 'sleep' to ensure the grid updates before the next keys. The trouble is that it all take...
- 22 Sep 2018, 19:12
- Forum: Ask for Help (v1)
- Topic: Ctrl+V to grid Topic is solved
- Replies: 3
- Views: 675
Ctrl+V to grid Topic is solved
I'm trying to paste text into a string grid, as shown in the image. When I use ^V, nothing happens. ^C works OK, and Ctrl+V works OK manually. Instead, to past a value I have to use F2 *before* ^V with delays, which slows the process. particularly when I'm doing lots of them. Any idea how I can get ...
- 20 Mar 2018, 16:38
- Forum: Ask for Help (v1)
- Topic: Problems with target window losing focus
- Replies: 4
- Views: 944
Re: Problems with target window losing focus
Thanks for that. No, not Excel - it's an app without any form of API (Excel would be easy).
- 20 Mar 2018, 04:23
- Forum: Ask for Help (v1)
- Topic: Problems with target window losing focus
- Replies: 4
- Views: 944
Re: Problems with target window losing focus
Okayyy. So that will let me stop the loop when the window loses the focus. I suspected that the problem was using Copy on an inactive window. Trouble is, the window contains a grid and I've only found one way to get the cell data, which is by using Copy. GetControlText isn't returning the cell conte...
- 18 Mar 2018, 19:50
- Forum: Ask for Help (v1)
- Topic: Problems with target window losing focus
- Replies: 4
- Views: 944
Problems with target window losing focus
I'm running a function that halts as soon as the target window loses focus. I have similar functions that don't use the clipboard which work OK, ie they continue when the window loses focus. Any suggestions? ;*** This function is used for replacing WAP [Blank] cells with nulls (by deleting them). ; ...
- 09 Oct 2017, 04:29
- Forum: Ask for Help (v1)
- Topic: Get text value from grid cell
- Replies: 3
- Views: 839
Re: Get text value from grid cell
I've been trying but can't get anything from the grid I've been checking out - the result is always blank (even though the cell has text in it). Could you provide a few more details, please?
- 08 Oct 2017, 20:55
- Forum: Ask for Help (v1)
- Topic: Get text value from grid cell
- Replies: 3
- Views: 839
Get text value from grid cell
I have an app which includes a grid, and I'd like to get the string value of the current cell.
Any ideas?
Any ideas?
- 23 Aug 2017, 20:08
- Forum: Ask for Help (v1)
- Topic: Keystring iterators
- Replies: 7
- Views: 1438
Re: Keystring iterators
Thanks guys, particularly for the code. A