Automating PowerDesigner

One more step of our automated build is solved.  I was able to automate PowerDesigner using Windows Script Host.  It isn’t the most elegant solution for sure, but it will do for now.

Here is a snippet of code:

set WshShell = CreateObject(“WScript.Shell”)
WshShell.Run “pdshell11.exe”
WScript.Sleep 2000
WshShell.SendKeys “^o”
WshShell.SendKeys MyModel.pdm

You can see that with this method, you could automate just about any piece of software – given that you can manipiulate it with keystrokes instead of mouse clicks.  I bet that eventually we will find a way to directly automate PD so othat we don’t have to use WSH.  Right now – while a build is in progress – you have to be very careful that you don’t touch the machine where the build is running.  If you change the active window while WSH is running, it will perform the .SendKeys on that window instead of PD.

This is something we would like to improve in the future, but for now it works.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: