Interprocess communication
-
So... made a jump from Newbies to the forum of the big boys: Developers' Forum. - I'm interested in ways of controlling SU externally and in ways of communicating with another app from SU.
I would basically like to write a conversion between PPT diagrams and a simple top view of similar SU objects, which would enable me to make nice renderings of the diagrams by using SU styles and 3D rendering methods.
This kind of interprocess communication can of course be handled by putting out a csv file, which would describe the diagram entities. This file could then be handled by a SU plugin. Someone seems to be writing ruby temp files which are activated as a SU command line argument or a ruby load. Then there is the possibility of embedding scripts in a WebDialog, and so forth.
Basically I would like to study in what ways SU and Windows automation can work together in an intimate way; ideally in a way whereby changes in one app (now PPT) would be reflected in the other (SU).
What are the best method of creating this kind of an interconnection?
-
look into Win32OLE.so
http://phrogz.net/ProgrammingRuby/lib_windows.html#WIN32OLE
and
http://phrogz.net/ProgrammingRuby/win32.html#rubyandmicrosoftwindows
slide down to "Windows Automation" -
Thanks, Dan. Your advice was very useful. I could have lost a lot of time on the other schemes which I referred to. The 'Programming Ruby' book by David Thomas and Andrew Hunt looks interesting.
Downloaded the .so extension modules, installed them and run a Ruby console session:
>require 'win32ole' true >ppt = WIN32OLE.new("PowerPoint.Application") #<WIN32OLE;0x11396c58> >ppt.Activate nil
That's it: PowerPoint was activated, so I'm ready to use PPT automation in a SU script as desired. Really elegant.
This scheme depends on the WIN32OLE extension written by Masaki Suketa. Can anybody give me advice on standard procedures for installation of such extensions on the machines of SU users.
My post had another aspect: We are now capable of using Ruby as a client for Windows Automation. What about the other direction. Can SU be extended to become an automation server?
Advertisement