Windows application automation

Hi all,

I wan’t to automate some applications which are running on mswin. Is it
somehow possible to “send” key prints to that application? For example
like “control s” for save.

Any suggestions?

Wolfgang

require ‘win32ole’ and read up on your favorite OLE browser.

What I’ve found is that I wind up fighting the (lack of) Ole
documentation as much as anything.

Here’s a simple Ruby script I’ve written to check a mail store via
Mapi for #of new messages and attachments:

require ‘win32ole’

mapiSession = WIN32OLE::new(‘Mapi.Session’)
logonParam = “server” + “\n” + “account”
mapiSession.Logon(‘ProfileInfo’ => logonParam)

new_messages = 0
total_messages = 0

mapiSession.Inbox.Messages.each {
|message|
begin
new_messages += 1 if(message[‘UnRead’])
total_messages += 1
puts message[‘Sender’].Address
puts message[‘Subject’]
puts 'Number of Attachments: ’ +
message[‘Attachments’].count.to_s
end
}

puts “You have #{new_messages} new message(s)”
puts “You have #{total_messages} total message(s)”

mapiSession.Logoff

Was there a particular application(Outlook, Excel, etc?) that you were
hoping to automate?

Hello Keith,

I have absolutely no information about OLE object that software uses. It
is a software for a microtomograph and I need to save images every
minute or so. All I would need is to send keyboard shortcuts to do the
task.

Wolfgang

Keith S. schrieb:

On 4/7/06, Wolfgang [email protected] wrote:

Hello Keith,

I have absolutely no information about OLE object that software uses. It
is a software for a microtomograph and I need to save images every
minute or so. All I would need is to send keyboard shortcuts to do the task.

Wolfgang

You can use the AutoItX com control to automate windows apps.

Try searching the list for autoit, there have been recent posts about
it and some have code samples.

Hello Cristi,

that looks really good! Thanks a lot!
Wolfgang

Cristi BALAN schrieb: