Skip to content

Instantly share code, notes, and snippets.

@tjluoma
Last active January 6, 2023 21:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjluoma/ca9bcbe0d905a759442f to your computer and use it in GitHub Desktop.
Save tjluoma/ca9bcbe0d905a759442f to your computer and use it in GitHub Desktop.
I use this with a Keyboard Maestro macro that runs whenever MSWord “deactivates” (in Keyboard Maestro terms). Updated with comments from http://apple.stackexchange.com/a/132171/9226
on hasDocument()
tell application "Microsoft Word"
every document is not missing value
end tell
end hasDocument
tell application "Microsoft Word"
if it is running and my hasDocument() then
save active document
end if
end tell
@RobTrew
Copy link

RobTrew commented May 28, 2014

Hi TJ - I did delete the first version :-) it didn't take account of the fact that .active_document can return missing value even when the document list is not empty ...

罗斌洲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment