Scripting newbie

Discussion, questions and support.
Post Reply
RadioGregg
Posts: 18
Joined: Apr 24th, ’22, 17:56

Post by RadioGregg » Jul 23rd, ’22, 04:12

I do a visual check of 300 data points in a table twice a day.
Typically I do this using my voice and a voice scripting app called TalonVoice, saying "next" and "previous" and a few other voice commands to work my way down to each successive line of data.
But sometimes I am in a place where I cannot comfortably say "next" 300 times, like on a plane!
So I am trying to figure out how to take my TalonVoice scripts and re-write them for FastKeys so I can use a few keys to accomplish the same thing...but I've been trying with the FastKeys scripting language for awhile, and I am not having any luck.
I know this is a big ask...but would someone help me convert this TalonVoice routine into a FastKeys script...I know once I see once script that works I can figure out how to do others:

key(down)
key(ctrl-c)
sleep(100ms)
mouse_move(85, 130) (This moves the cursor to a different application)
mouse_click(0) (This is a left mouse click)
sleep(100ms)
key(ctrl-t)
key(backspace)
sleep(200ms)
key(ctrl-v)
key(enter)
mouse_move(1550,-1530) (This moves the cursor back to the original application)
mouse_click(0)

Many thanks for any help you can offer...

Gregg
User avatar
Tom
Posts: 791
Joined: Nov 24th, ’15, 23:39

Post by Tom » Jul 23rd, ’22, 09:19

Code: Select all

Send, {Down}
Send, ^c
Sleep, 100
MouseMove, 85, 130
Click
Sleep, 100
Send, ^t
Send, {BackSpace}
Sleep, 200
Send, ^v
Send, {Enter}
MouseMove, 1550,-1530
;alternatively use this to move from its current position by X pixels to the right (left if negative) and Y pixels down (up if negative)
;MouseMove, 1550,-1530,, R 
Click
https://www.autohotkey.com/docs/commands/MouseMove.htm
https://www.autohotkey.com/docs/commands/Click.htm

There are several other commands you could use to automate this. In which format is your data? Maybe you could copy it to memory and let FastKeys do the check...
RadioGregg
Posts: 18
Joined: Apr 24th, ’22, 17:56

Post by RadioGregg » Jul 24th, ’22, 03:32

Wow, Tom, this is great! Thank you! It's like a tutorial on scripting.

I figured out by clicking the links you sent that I could eliminate the MouseMove command and just add x and y to the Click.

But here's the one thing that's stumped me...after the cursor goes to the correct coordinates 85, 130...I cannot get FastKeys to click there. And I've tried all kinds of approaches: MouseMove, 85, 130 and MouseClick, 85, 130 and Send, {Click, 85, 130}.

I added a long pause after this command to click so I could visually verify that the cursor is going to the correct spot...yes the cursor is there, but it won't click, it just moves to the next command line after the pause ends. And I tried changing the coordinates for the click to other spots in the same application, and it won't click there, either.

Have you ever encountered that?

I have the shortcut set as a "Command" vs Run or Send...is that correct?

Many thanks again, Gregg
User avatar
Tom
Posts: 791
Joined: Nov 24th, ’15, 23:39

Post by Tom » Jul 24th, ’22, 13:45

Are you saying that this does not produce a click?

Code: Select all

Click, 85, 130
Could you try running FastKeys as administrator? Or enable "Run as administrator" option in Preferences/General.

Is the destination window in focus?
https://www.autohotkey.com/docs/command ... tivate.htm
RadioGregg
Posts: 18
Joined: Apr 24th, ’22, 17:56

Post by RadioGregg » Jul 24th, ’22, 14:02

Perfect! I hade to enable "Run as Administrator"...now works great, thank you! :D :D :D :D :D :D :D
Post Reply