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:Guillaume Laforge (glaf@codehaus.org)
Date:Jan 3, 2005 7:15:28 am
List:org.codehaus.groovy.dev

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 :-)

Guillaume

Dierk Koenig wrote:

Scriptom is cool :-) Many Thanks to Guillaume for integrating the Groovy API.

I found that it can be used to call the Windows Scripting Host for Keystroke-Macros (even if you don't have a COM reference like for "notepad" in this example):

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

ALT = '%' SHIFT = '+' CTRL = '^'

'cmd /k notepad.exe'.execute()

// Windows Scripting Host shell host = new ActiveXProxy("WScript.Shell") host.AppActivate("Notepad")

Thread.sleep(1000)

// some keystrokes host.sendKeys('0/0{TAB}0/1{ENTER}1/0{TAB}1/1{ENTER}')

// function key to insert current date host.sendKeys('{F5}')

// replace all 0's by x host.sendKeys(CTRL+'h') host.sendKeys('0{TAB}x') host.sendKeys(ALT+'a') host.sendKeys('{ESC}') ---

cheers Mittie