Skip to main content
Inspiring
October 8, 2024
Answered

Autohotkey - how to press next menu command?

  • October 8, 2024
  • 1 reply
  • 783 views

This script executes first entry from a Scripts with name starting with "f". 

 

 

	RWin::Send, !frf

 

 

How to press second entry (script) which name starts with f?

Example, Scriprs menu commans (scripts): 

...
exportDocs
fitAndCenter
fitSelection
fitAndScale
...

 
Currently that script executes firAndCenter, but I need fitSelection.

This topic has been closed for replies.
Correct answer CarlosCanto

it might not be possible. As an alternative, after pressing Alt+F, R, press the down arrow as many times as needed to highlight your menu item, then press Enter

1 reply

CarlosCanto
Community Expert
CarlosCantoCommunity ExpertCorrect answer
Community Expert
October 10, 2024

it might not be possible. As an alternative, after pressing Alt+F, R, press the down arrow as many times as needed to highlight your menu item, then press Enter

Legend
October 11, 2024

CarlosCanto's way of doing things made it possible. However, it could not be executed with the Windows key alone in my environment, so the following code is triggered with the Windows key + A.

; Syntax of AutoHotkey 2.0
#HotIf WinActive("ahk_exe Illustrator.exe")

#A::{
  send("{Alt}frf{Down}{Enter}")
  return
}
Inspiring
October 11, 2024

@sttk3 it seems that 

frf{Down}{Enter}

still executes the first script on f, at least for the first version of AutoHotkey