4 messages in org.codehaus.groovy.devRE: [groovy-dev] [ANN] Scriptom: COM ...
FromSent OnAttachments
Guillaume LaforgeDec 30, 2004 10:14 am 
Dierk KoenigJan 3, 2005 7:01 am 
Guillaume LaforgeJan 3, 2005 7:15 am 
Dierk KoenigJan 3, 2005 7:47 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:RE: [groovy-dev] [ANN] Scriptom: COM Scripting in GroovyActions...
From:Dierk Koenig (dier@canoo.com)
Date:Jan 3, 2005 7:47:52 am
List:org.codehaus.groovy.dev

Here is another one. Export Appointments and Tasks from Outlook (e.g. for use in my personal wiki):

---- import org.codehaus.groovy.scriptom.ActiveXProxy

outlook = new ActiveXProxy("Outlook.Application") namespace = outlook.getNamespace('MAPI') CALENDAR_FOLDER = 9 TASK_FOLDER = 13

def printApps () { appointments = namespace.getDefaultFolder(CALENDAR_FOLDER) attributes = 'start end duration subject location alldayevent organizer importance sensitivity body'.split('\\s') count = appointments.Items.count.value for (i in 1..count) { appointment = appointments.Items.item(i) attributes.each {|detail| println detail +"\t:\t"+ appointment[detail].value } println '---' } }

def printTasks () { tasks = namespace.getDefaultFolder(TASK_FOLDER ) atts ='body importance lastmodificationtime mileage noaging saved sensitivity size subject unread actualwork complete contactnames datecompleted delegationstate delegator duedate isrecurring ordinal owner ownership percentcomplete recipients remindertime reminderoverridedefault responsestate role startdate status statusoncompletionrecipients statusupdaterecipients teamtask totalwork getrecurrencepattern statusreport'.split('\\s') count = tasks.Items.count.value for (i in 1..count) { task = tasks.Items.item(i) atts.each {|detail| println detail +"\t:\t"+ task[detail].value } } }

printApps() printTasks() ---- I'm afraid the code could be more "groovy"-style.

Should we call a contest of the grooviest examples?

cheers Mittie

-----Original Message----- From: Guillaume Laforge [mailto:glaf@codehaus.org] Sent: Montag, 3. Januar 2005 16:16 To: de@groovy.codehaus.org Subject: Re: [groovy-dev] [ANN] Scriptom: COM Scripting in Groovy

Hello Dierk,

Hey, that's a pretty nice example :-) If we have more and more intersting samples, we should even start a dedicated page of samples on Confluence!

This example is particularly interesting for doing some automated monkey testing with Groovy :-)