ZTree.com  | ZEN  | About...  

 Index   Back

[OT] AutoHotKey - I need some help   [OT]

By: Ben Kent       
Date: Jun 26,2018 at 16:47
In Response to: [OT] AutoHotKey - I need some help (Doug Borg)

> I know this is totally Off-Topic, but over the 13 years I’ve been
> on this board, I’ve seen a few off-topic requests for help from this
> extremely skilled community. Therefore, I thought I would seek help from
> my fellow ZTree-ers, since I’m pretty sure at least a few of you also
> use AutoHotKey (AHK).
> In Excel (2010, but I don’t think the version matters here), I am
> attempting to automate a string of ~55 keystrokes to be cycled ~1,200
> times with manual keyboard input required once in the basic cycle.
> Automating the repeat of the basic cycle is easy, and I don’t need any
> help with that. I have the basic cycle almost down; my issue is during
> the pause for keyboard input.
> While the basic cycle is running, certain index text from an Excel cell
> is copied to a background clipboard manager I use named Clipboard
> Recorder. The basic cycle pauses at the display of an Excel dialog box
> (“Add Scenario” for those who are curious) and waits for input.
> During the pause for keyboard input, the copied text can be manually
> pasted from Clipboard Recorder by pressing an ALT key down and holding
> it, then pressing the Z key once and releasing it quickly to avoid
> auto-repeating, and then releasing the ALT key. This keystroke sequence
> does not appear to be in conflict with Excel or any other running
> program.
> My problem is that for the life of me, I cannot figure out how to
> script the ALT-Z sequence in AHK so that the copied text is automatically
> pasted into the Add Scenario dialog box. I’m pretty sure it’s a
> variation of the SEND command in AHK, but I’ve tried many variations
> and none of them work.
> Does anyone have any ideas how to put this keystone into my macro’s
> basic cycle?


The send command would be
send !z

Have you tested sending Alt something to another app?

Which window needs to have focus?

You might need to do this to change focus
WinActivate [, WinTitle, WinText, ExcludeTitle, ExcludeText]

Are you sending to soon?
You might need to use WinWait and sleep

Your issue could be that the clipboard manager hooks the keyboard in a way that means that the AHK sent keys are not seen by the clipboard manager, you might need to use one of the other send* modes.

Or switch technique, have a AHK hotkey that starts the cycle at the Alt-z point, then one key-press per cycle.

Other things you might need to investigate
KeyWait Alt
hotkey ~ and $ modifiers


Thread locked

Messages in this Thread

94,952 Postings in 11,969 Threads, 349 registered users, 32 users online (3 registered, 29 guests)
Index | Admin contact |   Forum Time: May 24, 2020 - 6:10 pm EDT  |  Hits:31,221,968  (4,648 Today )
RSS Feed