From: Wolfgang Date: 2006-04-08T04:14:03+09:00 Subject: Re: windows application automation 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 Sader schrieb: > 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? > > > On 4/7/06, Wolfgang wrote: >> 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 >> >> >> > > > -- > Keith Sader > ksader@gmail.com > http://www.saderfamily.org/roller/page/ksader > >