Sign in to follow this  
Followers 0
anandnz

Commands help

5 posts in this topic

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

Share this post


Link to post
Share on other sites



#3 ·  Posted (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 by anandnz

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0