Last active
March 26, 2024 22:56
-
-
Save bjesuiter/d9c36f44481dfda6859c09add2217905 to your computer and use it in GitHub Desktop.
AppleScript Snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credits for this script to ALYB at https://forum.keyboardmaestro.com/t/applescript-save-microsoft-word-doc-x-document-to-pdf/20614 | |
tell application "Finder" | |
set input to selection | |
end tell | |
tell application id "com.microsoft.Word" | |
activate | |
set view type of view of active window to draft view | |
repeat with aFile in input | |
open aFile | |
set theOutputPath to ((aFile as text) & ".docx") | |
repeat while not (active document is not missing value) | |
delay 0.5 | |
end repeat | |
set activeDoc to active document | |
save as activeDoc file name theOutputPath file format format document | |
close active document saving no | |
end repeat | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Credits for this script to ALYB at https://forum.keyboardmaestro.com/t/applescript-save-microsoft-word-doc-x-document-to-pdf/20614 | |
tell application "Finder" | |
set input to selection | |
end tell | |
tell application id "com.microsoft.Word" | |
activate | |
set view type of view of active window to draft view | |
repeat with aFile in input | |
open aFile | |
set theOutputPath to ((aFile as text) & ".pdf") | |
repeat while not (active document is not missing value) | |
delay 0.5 | |
end repeat | |
set activeDoc to active document | |
save as activeDoc file name theOutputPath file format format PDF | |
close active document saving no | |
end repeat | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment