Hi, so I am in a text file (.txt, Word, browser window...) and I have created a Gui.
How do I trigger the Gui (which is now in focus) to send text *back to my text file* (instead of the Gui's own edit field)?
Is there something like "second last window in focus"?
GUI: input to text file?
Re: GUI: input to text file?
Iirc there is something like a z order. You might search for this on this forum.
ciao
toralf
toralf
Re: GUI: input to text file?
Assuming the Gui is created by your script - Just use:
Code: Select all
Gui, Show, NoActivate
Re: GUI: input to text file?
Thanks @uname, tried it but it did not work.
What I want to do is basically copy the Word symbol manager. I click a button in the Gui with "@" on it and @ appears in the Word document.
What I want to do is basically copy the Word symbol manager. I click a button in the Gui with "@" on it and @ appears in the Word document.
Re: GUI: input to text file?
OK, I managed it with:
Gui, Hide
Send, @
Gui, Show
return
But is there some better way to do it?
Gui, Hide
Send, @
Gui, Show
return
But is there some better way to do it?
Re: GUI: input to text file?
example send from GUI to WordPad
Code: Select all
pr=wordpad.exe
sc=ahk_exe WORDPAD.EXE
#NoEnv
#Warn
setworkingdir,%a_scriptdir%
SendMode Input
FileEncoding, UTF-8
Gui,1: -DPIScale
SS_REALSIZECONTROL := 0x40
Gui,1:Font,s13 cGray,Lucida Console
Gui,1:Color,Black,Gray
Gui,1:add,button ,x10 y10 h35 w100 ga1,@
Gui,1:add,button ,x130 y10 h35 w100 ga2,Ø
Gui,1:show, x10 y50 w500 h100,Send2wordpad
return
Guiclose:
exitapp
a1:
Gui,1:submit,nohide
gosub,check
;sendinput, % "{raw}@"
send,{text}@
return
a2:
Gui,1:submit,nohide
gosub,check
;sendinput, % "{raw}Ø"
send,{text}Ø
return
check:
IfWinNotExist,%sc%
{
Run, %pr%,,,pid2
WinWait,%sc%
}
IfWinNotActive ,%sc%,,WinActivate,%sc%
WinWaitActive,%sc%
return
Re: GUI: input to text file?
Thank you @garry.
However, I want to be able to sent my characters to *any* text window (.txt, Word, browser window...), whatever I click last.
The question is, can I do this more elegantly than with Gui, Hide/Show? It always makes my Gui flicker.
However, I want to be able to sent my characters to *any* text window (.txt, Word, browser window...), whatever I click last.
The question is, can I do this more elegantly than with Gui, Hide/Show? It always makes my Gui flicker.
Re: GUI: input to text file?
If use GUI-button, the GUI is active ...
example with Hotkey
example with Hotkey
Code: Select all
;- GroupAddx
SetTitleMatchMode, 2
GroupAdd, myPr, Mozilla Firefox
GroupAdd, myPr, Google Chrome
GroupAdd, myPr, Editor
GroupAdd, myPr, Notepad++
#IfWinActive, ahk_group myPr
F9::
send,{text}@
return
#IfWinActive
;- or
f8::
send,{text}@
return
Re: GUI: input to text file?
@Bernd
I had no answer how to send from GUI to any text window ... if click GUI-button the GUI is active and doesn't send ....However, I want to be able to sent my characters to *any* text window (.txt, Word, browser window...), whatever I click last.
The question is, can I do this more elegantly than with Gui, Hide/Show? It always makes my Gui flicker :
Gui, Hide
Send, @
Gui, Show
return
Who is online
Users browsing this forum: BielGuitarJP, CrowexBR, mebelantikjaya, Spawnova and 313 guests