I use this with Keyboard Maestro to automatically save the front-most document in Microsoft Word whenever Word deactivates:
tell application "Microsoft Word"
if it is running then
save active document
end if
end tell
This works great unless there is not an active document, in which case it throws an error.
I know I could ignore the error, but I would rather not.
I would like to know if there’s a proper AppleScript way to say something like “If active document exists, then save it.”
I tried Googling but only found this (what I have now).