Specifically, this code works to show LINES in my menu:
Code: Select all
FilePath= C:\RunningListOClip.txt
FileRead, Contents, %FilePath%
Sleep, 1000
Clipboard:= Contents
Sleep, 1000
Return
#z::
For each, line in StrSplit(Contents, "`r", "`n")
Menu, scripts, Add, %line%, Execute
Menu, scripts, Show
Return
Execute:
SendInput {Text}%A_ThisMenuItem%
Return
Code: Select all
FilePath= C:\RunningListOClip.txt
FileRead, Contents, %FilePath%
Sleep, 1000
Clipboard:= Contents
Sleep, 1000
Return
#z::
For each, paragraph in StrSplit(Contents, "`r", "`n`n") ; HERE'S THE FIRST NEW LINE
Menu, scripts, Add, %paragraph%, Execute ; HERE'S THE SECOND NEW LINE
Menu, scripts, Show
Return
Execute:
SendInput {Text}%A_ThisMenuItem%
Return
P.S. The text in my C:\RunningListOClip.txt textfile is currently:
[BeginningChronology]
[EndChronology]
Send !e
Sleep, 100
Send f
Sleep, 100
SendInput [EndChronology]
Sleep, 100
Send {Return}
Sleep, 2000
Send {Esc}
Sleep, 4000
Send {Back}
Sleep, 500
$583.76
5/13/2024 Refund of $583.76 from Account Due to Overpayment
So what I want to do is - if I click on the top menu item - it pastes:
"[BeginningChronology]
[EndChronology]"
If I click on the second menu item, it pastes:
"Send !e
Sleep, 100
Send f
Sleep, 100
SendInput [EndChronology]
Sleep, 100
Send {Return}
Sleep, 2000
Send {Esc}
Sleep, 4000
Send {Back}
Sleep, 500"
If I click on the third menu item, it pastes "$583.76"
And if click on the bottom menu item, it pastes "5/13/2024 Refund of $583.76 from Account Due to Overpayment"
Does that make sense?