jimollerhead Posted September 22, 2006 Share Posted September 22, 2006 I am trying to do a search and replace in notepad using this and nothing happens! My command is: WinMenuSelectItem("PVCS_insert.sql", "", "&Edit", "&Replace") where PVCS_insert.sql is my file name and at the beginning of my window title. I have tried replacing the underscore with {SHIFTDOWN}-{SHIFTUP} but that makes no difference -- it just does nowt. I also originally had the window name as "PVCS_insert.sql - Notepad" but that made no difference either. I have also tried WinActivate("PVCS_insert.sql") before the line but that doies nothing either. Has ANYONE out there managed to get this damned function to work??? Regards, (a soon to be hairless) Jim Link to comment Share on other sites More sharing options...
jimollerhead Posted September 22, 2006 Author Share Posted September 22, 2006 try...WinMenuSelectItem("PVCS_insert.sql", "", "&Edit", "&Replace... Ctrl+H")where the space between &Replace... and Ctrl+H is a TABLAr.Nope still no soap.... I have even tried copying and pasting your example from the help file (see below) and that doesn't work either.....WinMenuSelectItem("Untitled - ", "", "&File", "Page Set&up... Ctrl+H" )I will try it at home in case there is something odd about my work PC....Thanks for the quick response,Jim. Link to comment Share on other sites More sharing options...
jimollerhead Posted September 25, 2006 Author Share Posted September 25, 2006 (edited) OK Lar, after lots of grief and testing I can now get it to work consistently... The original problem was that "Notepad" was missing from the window title... then it began to work intermittently, sometimes yes, sometimes no... then I added a WinWait command as in the below: RunWait("Notepad.exe") WinWait("Untitled - Notepad") WinMenuSelectItem("Untitled - Notepad", "", "&File", "Page Set&up...") This seems to work every time.... HOWEVER, as soon as I add a file name to the RunWait command like so: RunWait("Notepad.exe test.txt") WinWait("test.txt - Notepad") WinMenuSelectItem("test.txt - Notepad", "", "&File", "Page Set&up...") ...it stops working again. I am going to try WinMenuSelectItem with &File, &Open to see if it will work that way -- I'll let you know. BTW the test.txt file is a tiny text file containing the words "test test test" I won't let the bugger beat me!! Regards, Jim. Edited September 25, 2006 by jimollerhead Link to comment Share on other sites More sharing options...
jimollerhead Posted September 25, 2006 Author Share Posted September 25, 2006 Ah ha!! Changing the WinWait to WinWaitActive seems to work!! Link to comment Share on other sites More sharing options...
jimollerhead Posted September 25, 2006 Author Share Posted September 25, 2006 Also I think it isn't a good idea to have underscores in the filename so I changed it to a hyphen Jim. 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