QAson Posted August 31, 2021 Share Posted August 31, 2021 I have been reading AutoIt documentation and watching tutorials to get an understanding of where it could be a good automation tool for my purposes. Step 1 was obviously a "hello world" so I have this which works fine when ran from the SciTE Editor or from .exe : #include <MsgBoxConstants.au3> MsgBox($MB_ICONINFORMATION, "Get pranked", "You can't code") So I moved on to something more advance and got this going: Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("This is some text.") WinClose("*Untitled - Notepad") WinWaitActive("Notepad", "Save") Send("{ENTER}") Send("test.txt") Send("{ENTER}") All this is supposed to to is open Notepad, wait for it to be open and active, write a small message, close, and ENTER through the default save location with the "test.txt" file name. This DOES work when ran in the SciTE Editor from Tools > Go. However, it DOES NOT work when I compile and run the .exe or use the .exe converter tool and nearly locks up my computer. I managed, one time, to open task manager and see that nearly a hundred notepads opened up in the background processes though nothing appeared to be occurring on screen. My mouse would just be stuck and flashing the loading/mouse icon. Any ideas? I went in as much detail as I could Link to comment Share on other sites More sharing options...
Developers Jos Posted August 31, 2021 Developers Share Posted August 31, 2021 (edited) Let me guess: you called the script notepad.au3 , hence the compiled script is called notepad.exe? Get it? Edited August 31, 2021 by Jos JockoDundee and Danp2 1 1 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...
Nine Posted August 31, 2021 Share Posted August 31, 2021 @Jos Your crystal ball has returned from the repair shop as I can see... Jos 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
QAson Posted August 31, 2021 Author Share Posted August 31, 2021 17 minutes ago, Jos said: Let me guess: you called the script notepad.au3 , hence the compiled script is called notepad.exe? Get it? I did.... I assume that is bad? I'm a new guy here, I don't understand Link to comment Share on other sites More sharing options...
Developers Jos Posted August 31, 2021 Developers Share Posted August 31, 2021 You are starting your own compiled script which then shell your own compiled script... which then......etc etc.. Call it something different. 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...
Solution Nine Posted August 31, 2021 Solution Share Posted August 31, 2021 Simply put, rename your script np.au3, then it will solve your current issue... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
QAson Posted August 31, 2021 Author Share Posted August 31, 2021 14 minutes ago, Nine said: Simply put, rename your script np.au3, then it will solve your current issue... Renaming the .au3 didn't work for me but renaming the .exe worked fine! Thanks y'all Link to comment Share on other sites More sharing options...
Nine Posted August 31, 2021 Share Posted August 31, 2021 (edited) 13 minutes ago, QAson said: Renaming the .au3 didn't work for me but renaming the .exe worked fine! Thanks y'all Ya, I was assuming you would delete any trace of the old script exe. But let me explain why it did work. In your head, Notepad.exe IS the editor from Microsoft. But, but, but, you created (when compiled) a new Notepad.exe exactly in the same directory of your script. So running that exe is running your script, and it searches for Notepad.exe, and found one directly in the same directory. So instead of calling the editor from MS, you were calling yourself, which was calling yourself, which was calling yourself, infinitely until you have no more memory left... Learning is the greatest thing of all the things human can do ! Edited August 31, 2021 by Nine “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
JockoDundee Posted August 31, 2021 Share Posted August 31, 2021 3 hours ago, QAson said: I managed, one time, to open task manager and see that nearly a hundred notepads opened up in the background processes though nothing appeared to be occurring on screen. Bonus question: Now let’s imagine, when in this state with a hundred notepads running, you were to start a real Notepad editor… What would be the contents of test.txt? Code hard, but don’t hard code... 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