Jump to content

How to get modern example scripts?


Gorlash
 Share

Go to solution Solved by Melba23,

Recommended Posts

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

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...

ScreenShot.jpg

Link to comment
Share on other sites

  • Moderators
  • Solution

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png 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 columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

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

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 by quickbeam
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...