I also have a request that I want the code layout to be as clear/simple as possible as I have plans on adding 20+ different texts (long paragraphs) in this drop-down menu. Maybe it's possible adding this portion of the code (the text it copies to the clipboard) right before ExitApp at the end of the code? So it doesn't muddle up the main code.
Or perhaps even saving these 20+ long paragraphs in a separate .ahk file which I can point to, and later on compile to an .exe file? Please show me the code for both alternatives if you can.
I also want separator lines or the likes in the drop-down choices to separate the 20+ different texts in categories, I assume the lines I've used in the code below is the best one can do?
Code: Select all
#NoEnv
#SingleInstance force
#Persistent
; Version 3.1
; Grab active window
WinGetActiveTitle, activeWinTitle
; Create popup-window
Gui, +AlwaysOnTop
Gui, Add, Text, x18 y7 w200 h20, ID:
Gui, Add, Edit, vID x18 y30 w190 h20
Gui, Add, Button, x20 y630 w90 h30 gCopy, Copy
; Add drop-down menu for prepared written text
Gui, Add, DropDownList, vPreparedText x260 y30 w300 h90, |A|B|-------------|C|D
Gui, Show, w590 h690,
; size of main window
MainWinWidth := 320
MainWinHeight := 580
; Create popup for Draft window besides main window.
Gui, +AlwaysOnTop
Gui, Add, Edit, x%MainWinWidth%+10 y32 x260 w%MainWinWidth% h%MainWinHeight%,
return
; Function that runs when the button "Copy" is pressed
Copy:
Gui, Submit, NoHide
Clipboard =
(
ID:
%ID%
)
; show confirmation popup
MsgBox, 64, Copied, Copy successful!
return
; Function to be executed when the GUI window is closed
GuiClose:
ExitApp
return