From: Chris Gehlker Date: 2002-08-06T13:13:54+09:00 Subject: Re: More questions on automation from na ïveWindows user. On 8/5/02 4:14 PM, "JamesBritt" wrote: >> Ok, here are the questions: >> >> 1) What is the relationship between ActiveScriptRuby and WIN32OLE? Is the >> latter useful by itself? > > The first is a stand-alone Ruby installation, while the latter is a loadable > module. > So, if you have, for example, the PragProg Windows version, and you install > ActiveScriptRuby, you end up with two separate versions of Ruby. Aha! Thanks. >> >> 2) How does the scripter know what capabilities the target application has >> under Windows? The example on page 168 of the PickAxe Book >> assumes a lot of >> knowledge on the part of the scripter about Excel's internal objects. Mac >> Excel has an object browser so it's easy to see what objects are inside >> Excel and to discover their methods. Does the same thing apply on >> Windows? I >> don't have Win Excel but I do have IE and it's supposedly >> scriptable. I just >> can't discover the vocabulary to script it. > > The VBA IDE that comes with Word, Excel, and other MS Office apps (or Visual > Studio IDE) provides very nice "IntelliSense (tm)", which is a tremendous > help. Most of my knowledge of the MS Word DOM comes from hacking about with > VBA. However, there also used to be nice outlines and images of the Office > object models on msdn.microsoft.com. I don't spend as much time on that > site as I used to :). Sounds like I just don't have enough "stuff" If I Win Office or VS I'd be home free. > If you have the opportunity, try using the VBA IDE to write some code in > VBScript first, using the intelligence goodness, then port it to Ruby once > you know the names of objects and their method signatures. > > >> >> 3) The PickAxe book talks about "dynamic lookups." Could someone provide >> some insight on how this works? > > Dotted paths are expensive. For example, if you have > > foo = Object.OtherObject.AndYetAnother.some_method > > then Object has to go get a reference to OtherObject, which in turn must go > get a reference to AndYetAnother, which then invokes some_method. I got that much. It's the mechanism that remains obscure. I guess my question boils down to this, "If Ruby can do these lookups at run time, then how come it can't do them at edit time? Why isn't IntelliSense built into Ruby on Windows? Thanks for taking the time to answer so thoroughly. -Chris -- When I was a boy I was told that anybody could become President. Now I'm beginning to believe it. -Clarence Darrow, lawyer and author (1857-1938)