scripting Word top copy text - should be simple, but ain't
scripting Word top copy text - should be simple, but ain't
- Subject: scripting Word top copy text - should be simple, but ain't
- From: "Charles Arthur, UKClimbing Editor" <email@hidden>
- Date: Tue, 25 Apr 2006 12:17:41 +0100
Here's my challenge. I've got hundreds of stories in Word format (some in
Word 95 format) that I want to open, copy the text from, summarise, paste
into a Tex-Edit window (or similar) and HTMLify, then upload to a database.
I can do all of these - except the first bit. The problem is that many of
the stories are in Word 95 format, which won't open properly in TextEdit
(which I'd otherwise use to do the opening bit). It creates all sorts of
control character junk at the top of the story.
However, Word 2004 can open such files happily. No junk.
However, I can't make head or tail of the Word 2004 dictionary. It's
enormous, but it's a sledgehammer/nut situation. I can't figure out how to
do something analogous to what in Tex-Edit Plus [which can't open Word
files cleanly either] would be something like
set thewindow to open thefile
set mytext to contents of thewindow
close thewindow
That is, just copy the darn text of what Word has just opened, then close
it. I can't see what in Word is the just-opened window.
This doesn't work (in a MSWord tell block):
set thewindow to open thefile
set thecontents to every word of thewindow
because Word's "open" doesn't return a reference. So "thewindow" is
unreferenced.
As you might guess, it's a teeny bit frustrating to be able to do
everything *except* the first step in such a project. Your help
appreciated. ("Don't use Word" doesn't quite count as help, though, unless
you have the time machine to take me back and save the files in RTF.)
best
Charles
--
http://www.ukclimbing.com : 1,000+ British crags, 350+ British climbing walls
- searchable by distance rock type, etc, with 5-day weather forecasts for
every one - plus maps, articles, news, and the New Routes database. There's
even a cool shop attached...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden