condor666 Posted February 17, 2011 Share Posted February 17, 2011 I tried to run the notepad script from the tutorial, but it doesn't write anything on the notepad. I'm runing it Windows 7 ultimate x64 french version. After that i tried to compile it and it created multiple instance of the program (approx. 50) Here is my modified script so that normally it should work on my machine : #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.6.1 Author: condor666 Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here Run("notepad.exe") WinWaitActive("Sans titre - Bloc-notes") Send("azerty") WinClose("Bloc-notes") WinWaitActive("Bloc-notes", "Voulez vous enregistrer les modifications de sans titre ?") Send("!r") Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted February 17, 2011 Moderators Share Posted February 17, 2011 Did you name your script notepad.au3 that when compiled is notepad.exe? ( that would explain why it keeps running copies of itself ). If so, rename it to something else. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
condor666 Posted February 17, 2011 Author Share Posted February 17, 2011 Ok, now the mutiple instance are solved, but it still writes nothing in the notepad. An idea ? Link to comment Share on other sites More sharing options...
ChrisL Posted February 17, 2011 Share Posted February 17, 2011 Is Sans titre - Bloc-notes exactly as it appears in the notepad window title? It's case sensative unless you change you Opt("WinTitleMatchMode") setting. [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Tvern Posted February 17, 2011 Share Posted February 17, 2011 Did you name your script notepad.au3 that when compiled is notepad.exe? ( that would explain why it keeps running copies of itself ).If so, rename it to something else.A note should be added to the tutorial about this. It seems like a pretty commong mistake. Link to comment Share on other sites More sharing options...
BigDod Posted February 17, 2011 Share Posted February 17, 2011 A note should be added to the tutorial about this. It seems like a pretty commong mistake.Surely it is common sense and does not need to be noted. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Tvern Posted February 17, 2011 Share Posted February 17, 2011 Surely it is common sense and does not need to be noted.Sense, yes. Common, not quite. This exact situation keeps popping up every now and then.The choice is between one person taking the time to review the tutorial (and possibly causing almost everyone reading it to waste 5 seconds of their lives) and aswering someone on the forum every now and then.I'm happy either way. Link to comment Share on other sites More sharing options...
Developers Jos Posted February 17, 2011 Developers Share Posted February 17, 2011 Adding notes like this will create a lengthy list of remarks which, by definition, aren't read. My vote goes to try to think and understand what you are doing when you see a program being shelled over and over. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
condor666 Posted February 17, 2011 Author Share Posted February 17, 2011 Is Sans titre - Bloc-notes exactly as it appears in the notepad window title? It's case sensative unless you change you Opt("WinTitleMatchMode") setting.Yes it is, i've taken a screenshot : Link to comment Share on other sites More sharing options...
bogQ Posted February 17, 2011 Share Posted February 17, 2011 (edited) try it like this Run("notepad.exe") If Not WinWait("Sans titre - Bloc-notes","",5) Then MsgBox(0,"Cant wait anymore","sry") Exit EndIf Sleep(100) SendKeepActive("Sans titre - Bloc-notes") Send("azerty") WinClose("Sans titre - Bloc-notes") Edited February 17, 2011 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
condor666 Posted February 17, 2011 Author Share Posted February 17, 2011 (edited) try it like this Run("notepad.exe") If Not WinWait("Sans titre - Bloc-notes","",5) Then MsgBox(0,"Cant wait anymore","sry") Exit EndIf Sleep(100) SendKeepActive("Sans titre - Bloc-notes") Send("azerty") WinClose("Sans titre - Bloc-notes") i've tried and it writes nothing, but the msgbox appears and don't closes the notepad Yes it is, i've taken a screenshot : I've discovered a strange thing, now it works partially, the text is still the same but i've copied it from AutoIt Window Info. It still doesn't close the program Edited February 17, 2011 by condor666 Link to comment Share on other sites More sharing options...
bogQ Posted February 17, 2011 Share Posted February 17, 2011 (edited) Probably some strange char in there try to run this and it will probably tell you where is that diffrent char (ASCll Character list from help file related), post the picture of msgbox if you wona share where and if it finded some diffrance in title #include <Array.au3> Run("notepad.exe") WinWaitActive("[CLASS:Notepad]") $c = StringSplit("Sans titre - Bloc-notes","") $a = StringSplit(WinGetTitle(""),"") Dim $b[$c[0]+1][2] For $y = 1 To $c[0] $c[$y] = Asc($c[$y]) $b[$y][1] = $c[$y] $a[$y] = Asc($a[$y]) $b[$y][0] = $a[$y] Next For $r = 0 to UBound($b,1) - 1 If $b[$r][0] <> $b[$r][1] Then MsgBox(0,$b[$r][0]&" diffrent from "&$b[$r][1]&" pos. "&$r,"'"&Chr($b[$r][0])&"' diffrent from "&"'"&Chr($b[$r][1])&"' on position "&$r) Next or try to use class instead of title in your script Edited February 17, 2011 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
condor666 Posted February 17, 2011 Author Share Posted February 17, 2011 I got this : Link to comment Share on other sites More sharing options...
bogQ Posted February 17, 2011 Share Posted February 17, 2011 (edited) Cool xDso there is diffrance in space charecters ("ASCll Charactes" help file)So try to use "[CLASS:Notepad]" instead of title from notepad win, and other class for your WinWaitActive("Bloc-notes", "Voulez vous enregistrer les modifications de sans titre ?"), use win info to get class (its probably "[CLASS:#32770]"), and it shud workor try Opt("WinTitleMatchMode", 2) and instead of full win title use first 10 char-s of title edit: (changed ASCII to ASCll in text above, misspelled it ) Edited February 17, 2011 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
condor666 Posted February 18, 2011 Author Share Posted February 18, 2011 I tried to type this and it doesn't works, it says missing separator WinWaitActive([CLASS:Notepad]) Link to comment Share on other sites More sharing options...
bogQ Posted February 18, 2011 Share Posted February 18, 2011 (edited) its WinWaitActive("[CLASS:Notepad]")you dont have "" look at the Edited February 18, 2011 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
condor666 Posted February 18, 2011 Author Share Posted February 18, 2011 Thanx, now it works with this : Run("notepad.exe") WinWaitActive("[CLASS:Notepad]") Send("This is some text.") WinClose("[CLASS:Notepad]") WinWaitActive("[CLASS:#32770]") Send("!r") 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