Have a script that silently and simultaneously saves a Word Document as a docx and as a pdf to a different Folder .
save as active document file name mynewDoc file format document
save as active document file name mypdfnewDoc file format format PDF
Every time the open file is recorded as modified it will also be saved again as pdf.
If the user first saves the file via the File Menu of MSW and then closes it, this process is again successful.
However if the user first closes the file via the window’s red button and then saves via the subsequent “Save” dialog the last iteration of the file cannot be saved as pdf (by this method anyway).
Hence my Query
- Is it possible, through scripting, to intervene after a windows red “close” button is clicked ?
The IF statement in the theoretical script below (not -in any way- a solution) demonstrates what I am trying to do.
It would, at first glance, appear possible as most programs will bring up a “Save” dialog after a window’s red “close” button has been clicked - that is, if the user has made any changes. I just want to get there before the “Save” dialog comes up. (though that includes the possibility that the user will throw out the most recent changes
-
Alternatively and better would be if after the red “Close” button is clicked And the “Save” button of the “Save” dialog is clicked the save as pdf process could be completed. A less elegant solution would be to reopen the file and then save to pdf and close.
-
Maybe some other solution altogether that has escaped this novice.
—MSW 2008 (Student & Home) No access to Word Automator action to Convert Files
The Non -Solution
on idle
tell application "Microsoft Word"
activate
end tell
tell application "System Events"
if click button 4 of window "Word Document" of process "Microsoft Word" is true then
display dialog "Remember to....." with title ("Reminder") buttons {"OK"} default button "OK" cancel button "OK"
rest of script here
end if
end tell
return 0.1
end idle
Any help or a definitive “No way” much appreciated.
Val