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: Walter Ian Kaye <email@hidden>
- Date: Thu, 4 Sep 2003 12:03:15 -0700
At 12:10p -0600 09/04/2003, David Crowe didst inscribe upon an
electronic papyrus:
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.
As you can tell by the repeat loop, I've coded this rather defensively... :)
set name_wdx to GetAppName("MSWD")
tell application name_wdx
--do stuff here, with raw codes
end tell
on GetAppName(crea)
tell application "System Events"
if not (exists (process 1 whose creator type is crea)) then
my OpenAppByID(crea)
repeat 60 times --make sure we get process; try every 2 secs
for 2 mins
delay 2
if exists (process 1 whose creator type is crea) then exit repeat
end repeat
end if
set n to name of (process 1 whose creator type is crea)
end tell
n
end GetAppName
on OpenAppByID(theID)
tell application "Finder" to open application file id theID
end OpenAppByID
-boo
_______________________________________________
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.