7121 Posted April 24, 2009 Share Posted April 24, 2009 i'm have a small problem understanding ControlSend. I have notepad2 so this might a little bit harder. What i want to do is copy a title of a certain window (ex: firefox) into the notepad file. Unfortunately, i do not want the notepad window to pop up, basically i do not want the window to be active during teh pasting. KEEP IN MIND it's NOTEPAD2 so yeah =/. Every time i do send it to the notepad, the window keeps popping back up so yeah. Link to comment Share on other sites More sharing options...
Nahuel Posted April 24, 2009 Share Posted April 24, 2009 And... why not write directly to a txt file? It needs to be on notepad? Link to comment Share on other sites More sharing options...
7121 Posted April 24, 2009 Author Share Posted April 24, 2009 well the thing is that the NOTEPAD or TXT file is already open and has to keep track on how the firefox title changes. Basically its recording a list of the firefox titles that pop up. So yeaah... but please, do enlighten me by WRITING DIRECTLY? do u mean actually writing to the txt file without opening it??? o_0?? is that possible??? *I still want to know how to use ControlSend though for future references Link to comment Share on other sites More sharing options...
Nahuel Posted April 24, 2009 Share Posted April 24, 2009 You can find all this in the help file. It's 100% better to simply write the txt file. Look at this code:HotKeySet("{esc}",'_exit') $FilePath = '' $FirefoxClass = '[CLASS:FirefoxWindow]' $sOldTitle = '' $FileHandle = FileOpen($FilePath,1) While 1 $s_Title = WinGetTitle($FirefoxClass) If $s_Title <> $sOldTitle Then FileWriteLine($FileHandle,$s_Title) $sOldTitle = $s_Title EndIf Sleep(500); WEnd Func _exit() FileClose($FileHandle) Exit EndFuncWhat you need to do before you run that, is check Firefox properties with Autoit Window Info. (You find it at Start->All programs->Autoit v3->Autoit Window Info). You need to check Firefox's class under Basic Window Info. Once you have it, replace 'FirefoxWindow' in $FirefoxClass, since I made that up.Read the following in the help file:FileOpenFileWriteFileWriteLineWindow Special Title Definition Link to comment Share on other sites More sharing options...
Zedna Posted April 24, 2009 Share Posted April 24, 2009 Use ControlSetText() instead of ControlSend() Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
7121 Posted April 25, 2009 Author Share Posted April 25, 2009 You can find all this in the help file. It's 100% better to simply write the txt file. Look at this code: HotKeySet("{esc}",'_exit') $FilePath = '' $FirefoxClass = '[CLASS:FirefoxWindow]' $sOldTitle = '' $FileHandle = FileOpen($FilePath,1) While 1 $s_Title = WinGetTitle($FirefoxClass) If $s_Title <> $sOldTitle Then FileWriteLine($FileHandle,$s_Title) $sOldTitle = $s_Title EndIf Sleep(500); WEnd Func _exit() FileClose($FileHandle) Exit EndFunc What you need to do before you run that, is check Firefox properties with Autoit Window Info. (You find it at Start->All programs->Autoit v3->Autoit Window Info). You need to check Firefox's class under Basic Window Info. Once you have it, replace 'FirefoxWindow' in $FirefoxClass, since I made that up. Read the following in the help file: FileOpen FileWrite FileWriteLine Window Special Title Definition hmmm, can it be consecutively??? as in , it can keep adding a NEW line of titles everytime.... Link to comment Share on other sites More sharing options...
Authenticity Posted April 25, 2009 Share Posted April 25, 2009 (edited) That is what it's doing, compares the old written title to the new title and if they're different write a line to the file. You may want to change the loop a little bit to get the title of the active FF window. Edited April 25, 2009 by Authenticity Link to comment Share on other sites More sharing options...
7121 Posted April 25, 2009 Author Share Posted April 25, 2009 ooh i seee. THANKS ^__^. unfortunately this forum does not do REP =/. OH, i manage to get the ControlSend to work =). Switched back to notepad though instead of notepad 2 . I do however have a new question.... does anyone know if ControlClick work on firefox (minimized) ??? Link to comment Share on other sites More sharing options...
FinalVersion Posted April 25, 2009 Share Posted April 25, 2009 ooh i seee. THANKS ^__^. unfortunately this forum does not do REP =/.OH, i manage to get the ControlSend to work =). Switched back to notepad though instead of notepad 2 .I do however have a new question....does anyone know if ControlClick work on firefox (minimized) ???Go look in example scripts and look for FF.au3. [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now