Re: Microsoft Word 5.1 versus Word for Office X
Re: Microsoft Word 5.1 versus Word for Office X
- Subject: Re: Microsoft Word 5.1 versus Word for Office X
- From: Paul Berkowitz <email@hidden>
- Date: Thu, 04 Sep 2003 12:01:56 -0700
You can start out by asking the Finder to System Events to
set wordXFilePath to ((path to applications folder as Unicode text) &
"Office X:Microsoft Word") -- or wherever you keep it
try
tell app "System Events" to set currentWordApp to first process
whose name contains "Microsoft Word"
on error -- Word isn't running
set currentWordApp to missing value
end try
if currentWordApp is not missing value then
tell app "System Events" to set currentWordPath to (application file
of process "Microsoft Word" as Unicode text") -- full file path
if currentWordPath is not wordXFilePath then
return -- if you want to leave 5.1 in place, or:
(* tell app currentWordPath to quit
tell app wordXFilePath to activate -- open Word X
*)
end if
generally, especially just for your own machine where you know the paths,
use full file paths for the name of copy of the application when you have
more than one.
--
Paul Berkowitz
>
From: David Crowe <email@hidden>
>
Date: Thu, 4 Sep 2003 12:10:14 -0600
>
To: <email@hidden>
>
Subject: Microsoft Word 5.1 versus Word for Office X
>
>
This is a related problem to the issue of transitioning between two
>
versions of an application that have the same name.
>
>
I have two versions of Microsoft Word on my computer. Microsoft Word
>
5.1 (circa 1992) and Word for Office X. The old version of Word still
>
opens some files that Word:X cannot open, and crashes less often (how
>
far Microsoft has gone in 10 years).
>
>
Normally, this is not a problem for scripting. Only Word:X is
>
scriptable, so scripts will include:
>
>
tell "Microsoft Word"
>
>
and everything is fine.
>
>
But, on the occasions when Microsoft Word 5.1 is running, but Word:X
>
is not (most likely because Word:X just crashed), AppleScript tries
>
to use Word 5.1 instead, which just results in some very vague errors.
>
>
Even changing the creator code for the old version of Word (from
>
"MSWD" to "WD51", for example) doesn't stop this from happening.
>
>
Again, this is more an annoyance than anything else, but it would be
>
nice to have protection against this in my scripts.
>
>
- David Crowe
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.