noob27 Posted July 15, 2010 Share Posted July 15, 2010 all, at the risk of looking like a fool, I need to find out what went wrong ... I discovered AutoIt two hours ago and I'm struggling to get started. even sample code fails for me: Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("This is some text.") WinClose("Untitled - Notepad") WinWaitActive("Notepad", "Do you want to save") Send("!n") the above hangs on the second WinWaitActive line (adding a timeout parameter works with the expected delay). I can make it work when I change this line to: WinWaitActive("Notepad", "Do") "Do you" or any other substring out of notepads save dialog window seems to fail again. and last but not least: every script that hung left a process running - I had to use taskmanager to kill about 20 autoit processes is this a noob problem, is it my environment (win7 64bit, english OS, but non english regional settings) or what??? AtDhVaAnNkCsE Link to comment Share on other sites More sharing options...
somdcomputerguy Posted July 15, 2010 Share Posted July 15, 2010 Change this line WinWaitActive("Notepad", "Do you want to save") to this WinWaitActive("Notepad"), and it'll probably work. Notepad's exit dialog box has changed since that tutorial was written.. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted July 15, 2010 Moderators Share Posted July 15, 2010 noob27,Welcome to the AutoIt forum. Someone else asked exactly the same question a few minutes ago - so you will find your answer here. Hanging scripts will continue to run. You can kill them by using the <Tools - Stop executing> menu option in SciTE, or via the tray icon menu - no need for Task Manager.Weel done for working through the Help file - the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page).Enjoy AutoIt. 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...
noob27 Posted July 16, 2010 Author Share Posted July 16, 2010 whoa - helpful gang here!!thanks a lot for the fast answers.I found out (too) that it's the second parameter that blocked me and omitting it certainly helps, but ...that's bad news, right? the reason to use that string is to find out if I'm getting the expected dialog. If notepad ever asks me "do you want me to stop formatting your system disk now" and I blindly confirm with ALT-N... so how do I find out what dialog text I can use to identify the correct window? can I only use strings that are visible thru the autoit window info tool? why does "Do" work while "Do you" and "you" fail? what's the difference? is that a notepad specific problem? do I better expect this kind of surprises in other (even all?) applications?notepad seems to be such a simple / vanilla application and failing tutorial code scares me a BIT.and thanks for the tutorial/wiki pointers - that will keep me busy for a lil' while Link to comment Share on other sites More sharing options...
JohnOne Posted July 16, 2010 Share Posted July 16, 2010 That is a very basic example, and not all windows expose their innards to third party applications, and some actively resist that sort of thing. However there are numerous ways of ensuring you are interacting with the correct window. WinTitleMatchMode option is one of those ways by setting it to use an exact match of window title. Using the window handle is another, and even the PID of the window can be used, (both of which can be gotten in different ways). 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...
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