marcoroc Posted July 30, 2013 Share Posted July 30, 2013 Please forgive my poor english (and noob question). INTRODUCTION I'm completely untrained in scripting, and i'm following a guide trying to learn something about autoit. TROUBLES During an exercise i wrote down the script below. run("notepad.exe") winwaitactive("Senza nome - Blocco note");("senza nome - blocco note" is the italian version of "untitled - notepad", yea we use "nameless" instead of "untitled" don't know why). send("some text here") winclose("Senza nome - Blocco note") winwaitactive("Blocco note") sleep(3000) send("!N") As i said, the result is an overwhelming cpu usage (and processes overcrowding (notepad.exe ofc)) that force me to reboot my pc. I tryed removing the "sleep(3000)" line, but it didn't improve my result. All i described happens only on the "compiled script" (script.exe) and not on the .au3 file. Link to comment Share on other sites More sharing options...
JohnOne Posted July 30, 2013 Share Posted July 30, 2013 If that is your full script (which I doubt) then you must have serious external computer issues. There is nothing in that which could possibly be the cause of the problem you describe. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
czardas Posted July 30, 2013 Share Posted July 30, 2013 (edited) This part >> winwaitactive("Blocco note") << check the title is correct using Window Info tool and also be sure to add the text. See if that fixes it. Edited July 30, 2013 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
CHOVIE Posted July 30, 2013 Share Posted July 30, 2013 Try This ... Run(@WindowsDir & "\Notepad.exe", "") WinWaitActive("[CLASS:Notepad]") send("some text here") sleep(3000) send("!N") WinClose("[CLASS:Notepad]") ..... To Be The Best You Have To Beat The Best ..... Link to comment Share on other sites More sharing options...
marcoroc Posted July 30, 2013 Author Share Posted July 30, 2013 (edited) I tryed removing all the lines, one at time, starting from the last one. run("notepad.exe") winwaitactive("Senza nome - Blocco note") If i leave only these lines (1st and 2nd), running the script gives me back the same error. (CPU usage over 95% and over 150-200-300... (and so on) processes in the task manager. With the first line left only run("notepad.exe") I still have the CPU usage "error", but the number of processes remains constant. Conclusion Running notepad mess my pc. Try This ... Run(@WindowsDir & "\Notepad.exe", "") WinWaitActive("[CLASS:Notepad]") send("some text here") sleep(3000) send("!N") WinClose("[CLASS:Notepad]") you have to Switch "send("!N")" with the last line, but it works fine. I would like to know why Edited July 30, 2013 by marcoroc Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted July 30, 2013 Moderators Share Posted July 30, 2013 What OS are you running? Which version of AutoIt? What process is eating up the CPU in Task Manager? I have tried your two lines of code on both XP and WIN7, both 32 and 64bit, and cannot reproduce your CPU issues. It seems to be something local to your machine. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted July 30, 2013 Moderators Solution Share Posted July 30, 2013 marcoroc,When you compile the file, are you calling it "Notepad.exe" by any chance? M23 0xdefea7, Tripredacus and BrewManNH 3 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
marcoroc Posted July 30, 2013 Author Share Posted July 30, 2013 (edited) marcoroc, When you compile the file, are you calling it "Notepad.exe" by any chance? M23 ahahahahahah i'm a fucking dumbass. Thanks everybody, problem solved. Edited July 30, 2013 by marcoroc dar100111 1 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 30, 2013 Moderators Share Posted July 30, 2013 marcoroc,You are not the first - and I am sure you will not be the last either! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Tripredacus Posted July 30, 2013 Share Posted July 30, 2013 No one's perfect! I did something silly like that once (well probably more than once but no picture evidence) 0xdefea7 1 Twitter | MSFN | VGCollect Link to comment Share on other sites More sharing options...
czardas Posted July 30, 2013 Share Posted July 30, 2013 (edited) LOL It had to be something in the name. Melba must have seen this before. I would never have guessed it would be that though. Edited July 30, 2013 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 30, 2013 Moderators Share Posted July 30, 2013 czardas, Melba must have seen this beforeQuite a few times - and it is nearly always a Notepad script that is involved. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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