How to set directory in save as combo box
mail at timgolden.me.uk
Fri Jun 13 12:44:29 CEST 2008
Couple of things, Gopal, which you might want to remember
when posting to mailing lists etc. One is that it's *much* better
(and more considerate) to post in plain text, not in HTML. (You
should be able to tell Outlook to use plain text). *Especially* when
posting code. And even *more* especially when posting Python
code where the layout is uber-important.
The other thing is that top-posting is not the norm in this group,
although it may be in others. The usual thing is to trim the email
you're replying to (or the newsgroup post or GGroup entry) so
that only the relevant text remains, and then put your replies
beneath or interspersed depending on what makes sense.
Now to the code itself:
> I am trying to save a file, it is working fine.
> But if the file is not on the foreground while setting combo box
> directory, changing the value in the combo box by setLookIn() appear on
> the foreground window.
[... snip code which finds a "Save As" window and sends it mouse messages ...]
I'm honestly not sure what you're trying to achieve here. I assumed that
*your* application was initiating the "Save As..." dialog. But this code looks
as though you're trying to automate some *other* application's dialog box.
Can you explain better what's going on?
Trying to poke values into other application's windows is fragile at best,
but if that's really what you want to do, have a look at a couple of projects
which specialise in that kind of thing:
+ WATSUP: http://www.tizmoi.net/watsup/intro.html
+ PyWinAuto: http://pywinauto.openqa.org/
Trying to poke values into *your own* application's windows is entirely
suspect: there's almost certainly a better way of doing it.
More information about the Python-list