Spacial 0 Posted August 15, 2014 New member. Apologies if this has been posted previously. I intend to use this tool with XP and W7. Not tried it with W7 yet. Working through the tutorial, in the second example, I cut and pasted the script into the empty script. It opens Notepad, prints the test, tries to close it, but doesn't accept Send("!n") instead, it hangs at the Yes No dialog. I tried altering the command to N, y and Y, but to no effect. I also tried, on my keyboard, pressing the Alt + n and it worked. Any ideas why Send("!n") doesn't work in XP? Share this post Link to post Share on other sites
water 2,359 Posted August 15, 2014 (edited) Welcome to AutoIt and the forum! You are talking about this script? Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("This is some text.") WinClose("Untitled - Notepad") WinWaitActive("Notepad", "Save") ;WinWaitActive("Notepad", "Do you want to save") ; When running under Windows XP Send("!n") Did you make the changes for XP as mentioned in the comment? Edited August 15, 2014 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
Exit 149 Posted August 15, 2014 Welcome to the forum. Show us your code. App: Au3toCmd UDF: _SingleScript() Share this post Link to post Share on other sites
Spacial 0 Posted August 15, 2014 Welcome to AutoIt and the forum! You are talking about this script? Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("This is some text.") WinClose("Untitled - Notepad") WinWaitActive("Notepad", "Save") ;WinWaitActive("Notepad", "Do you want to save") ; When running under Windows XP Send("!n") Did you make the changes for XP as mentioned in the comment? No, I pasted it in exactly as it said. I did notice that comment but couldn't see any indication of what it was for. Share this post Link to post Share on other sites
water 2,359 Posted August 15, 2014 I think (can't test any longer) your script should look like: Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("This is some text.") WinClose("Untitled - Notepad") WinWaitActive("Notepad", "Do you want to save") Send("!n") My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
Spacial 0 Posted August 15, 2014 I think (can't test any longer) your script should look like: Run("notepad.exe") WinWaitActive("Untitled - Notepad") Send("This is some text.") WinClose("Untitled - Notepad") WinWaitActive("Notepad", "Do you want to save") Send("!n") Not sure why as you don't explain. But I have tried altering it and still the same. I've run the program, AutoIt Window Info. It opens as (Frozen). I've found by removing the tick I can unfreeze it. It certainly responds. Below is an image of the text on those tabs in AutoIt Windows Info which have any. Hope this might help. Appreciate any advice Share this post Link to post Share on other sites
MikahS 92 Posted August 15, 2014 @Spacial I tested water's code on both XP and win 7 and it worked like a charm. Snips & ScriptsMy Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4Feel free to use any of my code for your own use. Forum FAQ Share this post Link to post Share on other sites
water 2,359 Posted August 15, 2014 This example runs fine on WIndows 7 and is language independant (I'm running a german system): Run("notepad.exe") WinWaitActive("[Class:Notepad]") Send("This is some text.") WinClose("[Class:Notepad]") WinWaitActive("[Class:#32770]") Send("!n") My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
MikahS 92 Posted August 15, 2014 Again, works like a charm with both @water Snips & ScriptsMy Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4Feel free to use any of my code for your own use. Forum FAQ Share this post Link to post Share on other sites
Spacial 0 Posted August 15, 2014 Thanks everyone. I've just run it on my W7 machine and it does indeed work well. But it doesn't in XP, which is a shame really. Share this post Link to post Share on other sites
water 2,359 Posted August 15, 2014 So the Art of Debugging would be the next thing to learn Run("notepad.exe") ConsoleWrite("1" & @CRLF) WinWaitActive("[Class:Notepad]") ConsoleWrite("2" & @CRLF) Send("This is some text.") ConsoleWrite("3" & @CRLF) WinClose("[Class:Notepad]") ConsoleWrite("4" & @CRLF) WinWaitActive("[Class:#32770]") ConsoleWrite("5" & @CRLF) Send("!n") ConsoleWrite("6" & @CRLF) Run this on Windos XP from Scite and check which numbers can be seen in the SciTE output pane. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
MikahS 92 Posted August 15, 2014 @spacial The only thing shameful is if you do not debug it Snips & ScriptsMy Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4Feel free to use any of my code for your own use. Forum FAQ Share this post Link to post Share on other sites
Spacial 0 Posted August 16, 2014 I would be more than pleased to debug it if I had a clue where to start. I've just started using this program, yet crashed on the second tutorial. There must be an answer, that much is obvious. But without some indication of where to look, I don't really see how I can find it. It works on the W7 machine so that's a start. I use XP much more than W7 though. Still, perhaps the answer is another maco compiler. Thank you anyway, for your time. Share this post Link to post Share on other sites
jchd 1,506 Posted August 16, 2014 Do you ever read answers? This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Share this post Link to post Share on other sites
Spacial 0 Posted August 16, 2014 Do you ever read answers? I do my best, when I know what it is I'm reading. I made the assumption that a tutorial, explaining the basics to someone, new to the routine, would avoid obfuscation at the start. I've previously learn other computer languages, in the 1980s, FORTH, BASIC and some assembly. Assuming I was missing something I came here, hoping to be pointed in the right direction. I will choose to rise above your attempted condescension. I'm sure most people here don't share your subliminal ambition to emulate your secondary school maths teacher. Share this post Link to post Share on other sites
water 2,359 Posted August 16, 2014 As most of the users on this forum have already moved to Windows 7 or later it isn't easy to help you. We just can give you some advice or example code. But you have to try it yourself. So please give post #11 a try. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
Spacial 0 Posted August 16, 2014 I understand and thank you for your efforts. As I said, I have both, but prefer to use XP because it is faster and more secure. I chose AutoIt because it did say it is compatable with all. I realise now, that the coding is different between XP and W7. This sadly was not made clear. I was hoping to have some indication of what those difference are. But I am grateful for your efforts none the same. The code in #11, I found this morning. It is 9.55 am here, though I think most of you are on the other side of the pond, where among other things, you have funny time. Share this post Link to post Share on other sites
water 2,359 Posted August 16, 2014 It's 11:05 am here, so I'm on the same side of the pond. Did you try the code in #11? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites
Spacial 0 Posted August 16, 2014 Yes I did. It seems to do exactly what the original code was supposed to. Share this post Link to post Share on other sites
water 2,359 Posted August 16, 2014 So the problem is solved? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2020-10-10 - Version 1.5.2.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX (NEW 2020-12-15 - Version 1.6.3.1) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2020-06-27 - Version 1.3.2.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - WikiTask Scheduler (2019-12-03 - Version 1.5.1.0) - Download - General Help & Support - WikiTutorials:ADO - Wiki, WebDriver - Wiki Share this post Link to post Share on other sites