I have been using AHK for a while now, but for simple send commands. Im trying to do some more advanced code but I hitted a wall.
Im trying to copy some text to be placed into a variable via Clipboard, so far so good.
The issue comes when i try to paste it back, I believe is related to the hierarchy but i can figure it out.
Any help would be appreciated
Code: Select all
titleString:= title ; attemp at global strings
textString:= text ;^^^^^
reset() ; quick reset of the AHK
{
msgbox,,, reset, .3
Run, "C:\Users\dmrjmrd\Desktop\AutoHotkey_1.1.24.04\CtoCS.ahk"
exitapp
}
f1(x)
{
global titleString:= title ; my understanding is that this would pull from the global variable...?
global textString:= text
clipboard =
x:= x
if(x == 1) ; copies selected text into title string
{
send, ^c
titleString := clipboard
msgbox,,, %titleString% copied,5 ; lets user know selection
}
else if(x == 2) ; same as the first if
{
send, ^c
textString := clipboard
msgbox,,, text copied,.1 ; quick feedback letting know the selection happened
}
else if(x == 3) ; here is the issue
{
msgbox,,, %titleString% + %textString% ,5 ; the message return only " + "
clipstring = <hr><h1>%titleString%</h1><hr><p>%textString%</p><p> </p> ; some html code that needs the previous strings added to it.
msgbox,,, %clipstring%, 5 ; confirm that the neither the title string or the text are present on the html string
clipboard = %clipstring%
send, ^v
}
else if(x == 4)
reset()
else
msgbox,,, you shouldnt be here D:, .5
}
f5::
counter++
f1(counter)
; reset()
return