On 7-Jun-08, at 3:14 PM, Daniel Lord wrote:
On Jun 7, 2008, at 11:48 AM, Rajanikanth Jammalamadaka wrote:
Suppose the application pops up a window while its running and gives
me two choices: Ok or Cancel
how can I tell it to select the Ok option always?
I don't have time to work up a demo right now, but you should be
able to use System Events:
Apple info: http://www.apple.com/applescript/uiscripting/
Here's a blog post that has a Python example you can use:
http://hexsprite.blogspot.com/2008/03/testing-osx-applications-with-python.html
Heres some random snippets of code from a test that may or may not be
useful that manipulate a file open dialog.
myapp.windows['Choose a Folder'].sheets[1].buttons['Go'].click()
myapp.windows['Choose a Folder'].buttons['Choose'].click()
Have fun,
-jordan (hexsprite)
_______________________________________________
Pythonmac-SIG maillist - Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig