« Script Debugger 4.0.6b2 | Home | Faster iLifeControls »
Avoiding Word & Excel AppleEvent Crashes
Microsoft Word and Excel can crash frequently when the Script Debugger Explorer is used. These crashes can also be caused by AppleScript. Here are some tips for avoiding many of these crashing bugs.
1) Turn off Script Debugger’s ‘Scan for elements of count fails’ Dictionary preferences option
Doing this will make it much less likely that Script Debugger’s Explorer will generate AppleEvents that cause Word or Excel to crash.
2) Avoid using the Exists commands in your scripts
I have found that asking Word or Excel if a non-existent object exists will very often cause a crash. For example, if you open a new document and run the following script, Word will crash:
tell application "Microsoft Word"
exists shape 1 of selection
end
The workaround is to use count:
tell application "Micorosft Word"
try
return count shapes of selection >= 1
on error
return false
end
end
About this entry
You’re currently reading “Avoiding Word & Excel AppleEvent Crashes,” an entry on Mark Alldritt's Journal
- Published:
- Feb 01 2007 / 8:05 am
Comments are closed
Comments are currently closed on this entry.