Gorlash Posted November 26, 2023 Share Posted November 26, 2023 Hi all; I have been a professional programmer for over 30 years, mostly in C/C++, but I am new to AutoIt... I am having quite a challenge finding example programs which actually work with AutoIt v3, on Windows 10 Pro ... After trying several other sources, I am currently working through "Learning to Script with AutoIt v3" by @BrettF, but it has a variety of errors already, even in the Notepad examples (section 2.3); some I can figure out, but others I have no idea!! As one example, I got WinClose() to work; I realized that it needed the star in the filename (indicating that the file had been modified)... I also needed to update the text in WinWaitActive() to actually match what the current message box displays... however: Send("!n") is not closing the program - and I have no idea what is wrong with the line!! I have tried several other tutorial sites, but most of them start with very advanced examples, and the ones that have simple examples, do not actually work... How do I proceed?? Link to comment Share on other sites More sharing options...
Gorlash Posted November 26, 2023 Author Share Posted November 26, 2023 Oops, I should have included relevant data; apparently I cannot edit a message once posted... I am enclosing an image of the dialog that I'm getting, and will include the relevant couple of lines of code... WinClose("*Untitled - Notepad") WinWaitActive("Notepad", "Do you want to save changes to Untitled?") Send("!n") Note that the original example had "Do you want to save changes", which did not work, so I assumed that the function had to exactly match the text in the message box... but this doesn't work either... apparently something else is missing... Link to comment Share on other sites More sharing options...
Moderators Solution Melba23 Posted November 26, 2023 Moderators Solution Share Posted November 26, 2023 Gorlash, Welcome to the AutoIt forums. Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) should help. We do try to keep those tutorials up to date every time Windows changes the way it presents dialogs! This thread might be of help: I would also recommend this really useful book: Although it might be a little basic for you, given your background. M23 Jfish 1 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...
Gorlash Posted November 26, 2023 Author Share Posted November 26, 2023 Hi @Melba23 !! Thank you for the prompt response!! I will check out all the leads that you offered... Link to comment Share on other sites More sharing options...
argumentum Posted November 26, 2023 Share Posted November 26, 2023 WinClose("*Untitled - Notepad") WinActivate("Notepad") Sleep(200) Send("!n") ...it's simple once you get acquainted with the notions. A good tool is ControlViewer, if I say so myself Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Gorlash Posted November 26, 2023 Author Share Posted November 26, 2023 Hey, @Melba23... it turns out that your first suggestion (the AutoIt help file) is *exactly* where I should have started... It starts with the same three examples that the tutorial that I referenced did - except that they all work!!! Amazing... well, I'll continue working from there, as well as reading the other guide that you recommended... Link to comment Share on other sites More sharing options...
quickbeam Posted November 27, 2023 Share Posted November 27, 2023 (edited) I'll agree not all the documentation is up-to-date. This tutorial for example, doesn't have correct formatting, making it hard to follow right from the start: https://www.autoitscript.com/autoit3/docs/tutorials/notepad/notepad.htm (I tried it on Brave (Chrome variant), Firefox and Edge, none of them displayed the code segments correctly). As I recall, there were a couple minor errors in the code examples as well. But the language reference, function reference, etc at https://www.autoitscript.com/autoit3/docs/ is all very helpful. Edited November 27, 2023 by quickbeam 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