convert word to pdf
I recently got a new computer. Old computer - mid 2007 iMac running Mavericks (OS 10.9). New computer: late 2013 iMac running Mavericks (OS 10.9).
On my old computer I had an automator workflow/application that would convert a Word file to a pdf. It is uses an Applescript I got off the web. On my old computer I never had any problems running the script. On my new computer, which I used migration assistant to set up, I cannot get this script to run. I always get error messages.
If I try and run the workflow I get the following: Check the actionʼs properties and try running the workflow again.
If I go into automator and try and run the script I get the folllowing: Run Applescript failed - 1 error/Can't continue get default file path.
Does anyone have any idea why this won't run properly on my new computer? I am at a complete loss (not to mention, not an applescript guru...)
Any help would be greatly appreciated.
Thank you.
The applescript is below:
property theList : {"doc", "docx"}
on run {input, parameters}
set output to {}
tell application "Microsoft Word" to set theOldDefaultPath to get default file pathfile path typedocuments path
repeat with x in input
try
set theDoc to contents of x
tell application "Finder"
set theFilePath to container of theDoc as text
set ext to name extension of theDoc
if ext is in theList then
set theName to name of theDoc
copy length of theName to l
copy length of ext to exl
set n to l - exl - 1
copy characters 1 through n of theName as string to theFilename
set theFilename to theFilename & ".pdf"
tell application "Microsoft Word"
set default file pathfile path typedocuments pathpaththeFilePath
open theDoc
set theActiveDoc to the active document
save astheActiveDocfile formatformat PDFfile nametheFilename
copy (POSIX path of (theFilePath & theFilename as string)) to end of output
closetheActiveDoc
end tell
end if
end tell
end try
end repeat
tell application "Microsoft Word" to set default file pathfile path typedocuments pathpaththeOldDefaultPath
return output
end run
iMac (27-inch, Late 2013)