anandnz Posted February 6, 2011 Share Posted February 6, 2011 Hi Gurus, Please can i know the commands i should use/play around to achieve following objectives 1. $pid = run ( "third party application), if $pid, ; Start a timer, when it expires, exit/kill the application I tried using _Timer_Set_Timer and was passing the $pid, instead of handle, as pointed by Guru varian. I could not find a timer associated with a third party call. 2. For each documents in the directory and sub-directory, convert them to read only. ; at the end of the application 3. command to enable to overwrite the files when read only ; at the start of the application 4. Close all the word documents except one document titled "output doc ". ; the third party application has a bug which sometimes it opens more than 300 documents recursively and automation hangs. PS: commands to be non bloking as they should work when pc is locked. Many Thanks --Anand Link to comment Share on other sites More sharing options...
JohnOne Posted February 6, 2011 Share Posted February 6, 2011 Run() TimerInit() TimerDiff() _FileListToArray() FileSetAttrib() 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...
anandnz Posted February 7, 2011 Author Share Posted February 7, 2011 (edited) Thank you JohnOne. Much appreciated. I am using _WinAPI_EnumWindows() to handle the error scenarios. Unfortunately, the thrid party is poor in naming the dialog boxes, every thing is a "error" and is it because of popup (?) not sure the class too is same. I have done multiple testing and found that handle, error and class remain same for different error dialogs thrown. so i need to use wildcard in the "visible text" Autolt window info or WinGetText($WindowInfo[$i][0]) from _WinAPI_EnumWindows() My questions 1. Is my assumption to use the $info = _WinAPI_EnumWindows(), WinGetText($WindowInfo[$i][0]) string comparision the only way to differentiate other window dialog boxes? 2. Any autolt inbuilt commands to say search for this " Error opening word document " in the variable $info. So that i can call appropriate error handling functions. Thanks a lot -- Anand Edited February 7, 2011 by anandnz Link to comment Share on other sites More sharing options...
JohnOne Posted February 7, 2011 Share Posted February 7, 2011 I'm not certain I fully understand what you are needing. there is _WinAPI_EnumWindowsTop() _WinAPI_EnumWindowsPopup() You also might want to look at WinList() and look into WinTitleMatchMode Option. Another thing you might want to consider is posting your code, sometimes looking at code, there is no need to communicate via words. 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...
anandnz Posted February 7, 2011 Author Share Posted February 7, 2011 Hi John. Thank you. I will look into the functions you mentioned, still redesigning code and present to you by tonight. Just to make sure, i could get the present atleast what i want in code. But if you are generous to advice, which i would take in my redesign and rearrangement of the function. The link here has the code and functions with intent in words still. ( In the end) I am developing to split them into functions, i will add this piece as a comparator after your comments, this searches the string of the visible text of the dialog box captured. $err = FileReadLine($file) If @err = -1 Then ExitLoop If $file = "Error opening word document" Many thanks in advance --Anand 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