Win32ole equivalent for Mac OS X

N

Nathan Loyer

Is there an equivalent library for the Win32ole library on the PC? I
use this library to read word .doc files, but when I try to run the
script on Mac OS X, it doesn't recognize it. Any possibilities?
 
R

reuben doetsch

[Note: parts of this message were removed to make it a legal post.]

Look at ruby cocoa
 
N

Nathan Loyer

Nathan said:
Is there an equivalent library for the Win32ole library on the PC? I
use this library to read word .doc files, but when I try to run the
script on Mac OS X, it doesn't recognize it. Any possibilities?

Just to clarify, I'm trying to read a word .doc file on OS X, not do
generic automation.
 
N

Nathan Loyer

Glen said:
http://www.macdevcenter.com/pub/a/mac/2007/02/27/replacing-applescript-with-ruby.html?page=2

--
"Hey brother Christian with your high and mighty errand, Your actions
speak
so loud, I can't hear a word you're saying."

-Greg Graffin (Bad Religion)

Thanks, but for some reason, I can't install rb-appscript. I get this
error:

Building native extensions. This could take a while...
ERROR: Error installing rb-appscript:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb install rb-appscript
can't find header files for ruby.


Gem files will remain installed in
/Library/Ruby/Gems/1.8/gems/rb-appscript-0.5.1 for inspection.
Results logged to
/Library/Ruby/Gems/1.8/gems/rb-appscript-0.5.1/gem_make.out
roboticbuddha:documents User$ ruby mergeAMdata.rb
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- appscript (LoadError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
from mergeAMdata.rb:7
 
G

Glen Holcomb

[Note: parts of this message were removed to make it a legal post.]

Thanks, but for some reason, I can't install rb-appscript. I get this
error:

Building native extensions. This could take a while...
ERROR: Error installing rb-appscript:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb install rb-appscript
can't find header files for ruby.


Gem files will remain installed in
/Library/Ruby/Gems/1.8/gems/rb-appscript-0.5.1 for inspection.
Results logged to
/Library/Ruby/Gems/1.8/gems/rb-appscript-0.5.1/gem_make.out
roboticbuddha:documents User$ ruby mergeAMdata.rb
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- appscript (LoadError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
from mergeAMdata.rb:7
Sorry, can't help you there. I'm not at all versed in build environments in
OS X. I would suggest checking your LD_LIBRARY_PATH and making sure the
headers for ruby are there but beyond that I have no idea.
 
L

Laurent Sansonetti

Thanks, but for some reason, I can't install rb-appscript. I get this
error:

Building native extensions. This could take a while...
ERROR: Error installing rb-appscript:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb install rb-appscript
can't find header files for ruby.


Gem files will remain installed in
/Library/Ruby/Gems/1.8/gems/rb-appscript-0.5.1 for inspection.
Results logged to
/Library/Ruby/Gems/1.8/gems/rb-appscript-0.5.1/gem_make.out
roboticbuddha:documents User$ ruby mergeAMdata.rb
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in
`gem_original_require': no such file to load -- appscript (LoadError)
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:27:in `require'
from mergeAMdata.rb:7
--

Did you install the Xcode package? Ruby's header files, as well as the
compiler, are not bundled with the default Mac OS X install.

Laurent
 
N

Nathan Loyer

Laurent said:
Did you install the Xcode package? Ruby's header files, as well as the
compiler, are not bundled with the default Mac OS X install.

Laurent

No, how do I do that?
 
J

John Joyce

RubyCocoa is to interface with the Cocoa API.
Cocoa is BIG.
The ability to open and read contents of .doc files is there.
Your mileage will vary of course, depending on what features of what
versions of Word are included in the file.
The Cocoa AppKit class NSTextView can display the contents easily.
You've got an uphill battle though, lots to learn to do it. It all
depends on what you want to do with it though.
You could easily use rb-appscript with the application TextEdit
(bundled on every OS X system with open source bundled with XCode).
That should get you enough to see if it is worth it to you.
doc is one of many file formats native to OS X, but again, your
mileage will vary.
 
M

M. Edward (Ed) Borasky

Is there a word .doc format reader class in Cocoa? I wasn't aware of
that?

There are open source libraries that will read a Word doc. Maybe you can
interface to one of them.

* app-text/wv
Latest version available: 1.2.4
Latest version installed: 1.2.4
Unstable version: 1.2.4
Use Flags (stable): +wmf
Size of downloaded files: [no/bad digest]
Homepage: http://wvware.sourceforge.net/
Description: Tool for conversion of MSWord doc and rtf files to
something readable
License: GPL-2

* app-text/wv2
Latest version available: 0.2.3
Latest version installed: 0.2.3
Unstable version: 0.2.3
Use Flags (stable): -
Size of downloaded files: [no/bad digest]
Homepage: http://wvware.sourceforge.net
Description: Excellent MS Word filter lib, used in most Office
suites
License: LGPL-2


--
M. Edward (Ed) Borasky
ruby-perspectives.blogspot.com

"A mathematician is a machine for turning coffee into theorems." --
Alfréd Rényi via Paul Erdős
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top