Menu and actions

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
S_N
Posts: 10
Joined: 19 May 2019, 13:38

Menu and actions

29 Nov 2021, 18:28

I’m trying to achieve following

Pop-up menu that gets label from first column in a separate file (table) , and when clicked/selected it pastes 2nd column contents from the table

EDIT: found something that was previously discussed- menu from a csv file !
viewtopic.php?t=66278#p285071
Last edited by S_N on 29 Nov 2021, 21:50, edited 1 time in total.
User avatar
mikeyww
Posts: 26880
Joined: 09 Sep 2014, 18:38

Re: Menu and actions

29 Nov 2021, 18:39

It's best if you provide the table, along with a specific example pertaining to it.
S_N
Posts: 10
Joined: 19 May 2019, 13:38

Re: Menu and actions

29 Nov 2021, 18:48

Table file - i’m trying to make simple for someone else to add/edit to it, just by wditing the text not having to deal with coding stuff

Example table i think

Label1, text line of text hwre
Label2, text paragraph
with line breaks
Label3, text something else
Label3(submenu item), text etc
User avatar
mikeyww
Posts: 26880
Joined: 09 Sep 2014, 18:38

Re: Menu and actions

29 Nov 2021, 22:01

Here is a way to get started.

Code: Select all

table =
(
Label1, text line of text hwre
Label2, text paragraph

Label3, text something else
Label3(submenu item), text etc
)
text := {}
For each, line in StrSplit(table, "`n") {
 RegExMatch(line, "(.+?),(.+)", part)
 If (part1 = "")
  Continue
 text[part1] := Trim(part2)
 Menu, items, Add, %part1%, Paste
}

F3::Menu, items, Show

Paste:
SendInput % "{Text}" text[A_ThisMenuItem]
Return
S_N
Posts: 10
Joined: 19 May 2019, 13:38

Re: Menu and actions

30 Nov 2021, 12:02

Thank you

How do i make sub-menu?
User avatar
mikeyww
Posts: 26880
Joined: 09 Sep 2014, 18:38

Re: Menu and actions

30 Nov 2021, 12:09

Here is an example. https://www.autohotkey.com/docs/commands/Menu.htm#ExPopup
You would have to decide when to add such a menu.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, mikeyww, Nerafius, scriptor2016 and 109 guests