Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Ruby and WSH How?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Andres M. Hidalgo  
View profile  
 More options Aug 31 2005, 7:59 pm
Newsgroups: comp.lang.ruby
From: "Andres M. Hidalgo" <ahida...@bellatlantic.net>
Date: Wed, 31 Aug 2005 23:59:24 GMT
Local: Wed, Aug 31 2005 7:59 pm
Subject: Ruby and WSH How?
Any ideas or links to Ruby and WSH(Windows Scripting Host)?
Can I use Ruby with .HTA(HTML for applications)?.

Thanks
Andres


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Takashi Sano  
View profile  
 More options Aug 31 2005, 8:29 pm
Newsgroups: comp.lang.ruby
From: Takashi Sano <tks...@gmail.com>
Date: Thu, 1 Sep 2005 09:29:22 +0900
Local: Wed, Aug 31 2005 8:29 pm
Subject: Re: Ruby and WSH How?
Hello Andres,

2005/9/1, Andres M. Hidalgo <ahida...@bellatlantic.net>:

> Any ideas or links to Ruby and WSH(Windows Scripting Host)?
> Can I use Ruby with .HTA(HTML for applications)?.

You can do it with ActiveScriptRuby. Though I myself have not experienced that.

There are several sample files in samples folder of the installed location.

Takashi Sano


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zach Dennis  
View profile  
 More options Aug 31 2005, 8:46 pm
Newsgroups: comp.lang.ruby
From: Zach Dennis <zden...@mktec.com>
Date: Thu, 1 Sep 2005 09:46:05 +0900
Local: Wed, Aug 31 2005 8:46 pm
Subject: Re: Ruby and WSH How?

Takashi Sano wrote:
> Hello Andres,

> 2005/9/1, Andres M. Hidalgo <ahida...@bellatlantic.net>:

>>Any ideas or links to Ruby and WSH(Windows Scripting Host)?
>>Can I use Ruby with .HTA(HTML for applications)?.

I have used Ruby and WSH. It is beautiful. Documentation is sparse, so
trial and error is a must, although it is really straightforward stuff
once you get used to it. Use Win32OLE to access WSH...

Example:
     require 'win32ole'
     wscript_shell = WIN32OLE.new( 'WScript.Shell' )
     wscript_shell.Popup( 'message', 0, 'title', 1 )

Most WSH commands are executed just like you would execute them in
VBScript...

Here is an examle of how to get system drive information:
     require 'win32ole'
     drives = []
     file_system = WIN32OLE.new( 'Scripting.FileSystemObject' )
     file_system.Drives.each { |drv| drives << drv.DriveLetter }
     drives

If you want any more hardcore examples I'll see what I can dig up!

Zach


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Burt  
View profile  
 More options Aug 31 2005, 9:18 pm
Newsgroups: comp.lang.ruby
From: "Dave Burt" <d...@burt.id.au>
Date: Thu, 01 Sep 2005 01:18:38 GMT
Local: Wed, Aug 31 2005 9:18 pm
Subject: Re: Ruby and WSH How?

Zach wrote:
> I have used Ruby and WSH. It is beautiful. Documentation is sparse...

There is good documentation around! There's the Microsoft website, which has
a complete reference to all their APIs (I think, I haven't checked them
all). But they're a megabyte per page or something ridiculous like that.

Let me recommend DevGuru.com:

WSH Reference: http://devguru.com/technologies/wsh/17346.asp
VBScript ("Scripting") library reference:
http://devguru.com/technologies/vbscript/13990.asp

I also use their quick reference for ASP programming.

Also, back to Ruby's WIN32OLE, every WIN32OLE object has an ole_methods
method which returns all its properties and methods as an array. (Although
in a recent thread I discovered that it doesn't always work; but it will
with the WShell and Scripting libraries.)

Cheers,
Dave


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zach Dennis  
View profile  
 More options Aug 31 2005, 10:05 pm
Newsgroups: comp.lang.ruby
From: Zach Dennis <zden...@mktec.com>
Date: Thu, 1 Sep 2005 11:05:46 +0900
Local: Wed, Aug 31 2005 10:05 pm
Subject: Re: Ruby and WSH How?

I guess I meant documentation for using WIN32OLE and WScript...etc... I
know that, documentation is one thing MS is good at... I didn't mean to
imply there wasn't documentation on WSH.

Zach


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Burt  
View profile  
 More options Aug 31 2005, 10:26 pm
Newsgroups: comp.lang.ruby
From: "Dave Burt" <d...@burt.id.au>
Date: Thu, 01 Sep 2005 02:26:53 GMT
Local: Wed, Aug 31 2005 10:26 pm
Subject: Re: Ruby and WSH How?
Zach Dennis:

> I guess I meant documentation for using WIN32OLE and WScript...etc... I
> know that, documentation is one thing MS is good at... I didn't mean to
> imply there wasn't documentation on WSH.

Well, you're right then. But it is pretty simple. So simple I'm going to
document it right now (ruby-doc.org?).

This is WIN32OLE, from VB:

require 'win32ole'

# Set my_com_object = CreateObject("Library.Class")
my_com_object = WIN32OLE.new("Library.Class")

# Set my_com_object = GetObject("Library.Class")
my_com_object = WIN32OLE.connect("Library.Class")

# For Each com_object In com_collection_object
# '...
# Next
for com_object in com_collection_object
#...
end

# (Press F1 and read the help?)
com_object.ole_methods  #=> [Array, Of, All, Methods, And, Properties,
                        #=> Available, For, This, Object]

And the rest is straightforward. COM properties and methods become methods
of the WIN32OLE object. If there's a Ruby name clash (e.g. a "class"
property), you can either change the case of the method (COM's case
insensitive) (com_object.Class or com_object.cLaSs) or use [] and []=
(com_object['class'] is an lvar).

Cheers,
Dave


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google