Estoy buscando una manera de convertir por lotes/convertir por lotes .doc
archivos en .docx
archivos. He encontrado esto Charla de TidBITS que hace referencia a un Hilo rojo para un AppleScript (AS) y un enlace muerto de DropBox para una integración en Automator de dicho AS en un WorkFlow.
Sin embargo, cuando ejecuto el script en Automatizador o script Editor Tengo un Error de sintaxis - Esperaba el final de la línea, etc. pero encontró el identificador. Dentro del script compatibility
se destaca (por ser el problema, supongo).
¿Qué se puede hacer para corregir el error?
Encuentra la nueva versión sugerida por @CJK de todo el script aquí abajo:
property theList : {"doc"}
on run {input, parameters}
set output to {}
tell application "Microsoft Word" to set theOldDefaultPath to get default file path file path type documents path
repeat with theDoc in input
tell application "System Events"
set theFolderPath to the path of theDoc's container
set theExtension to name extension of theDoc
set theName to name of theDoc
end tell
if theExtension is in theList then
set l to the length of theName
set exl to the length of theExtension
set n to l - exl - 1
set theFilename to (text 1 through n of theName) & ".docx"
tell application "Microsoft Word"
set default file path file path type documents path path theFolderPath
open theDoc
set theActiveDoc to the active document
save as theActiveDoc file format format document file name theFilename without maintain compatibility
close theActiveDoc
end tell
set end of output to the POSIX path of (theFolderPath & theFilename)
end if
end repeat
tell application "Microsoft Word" to set default file path file path type documents path path theOldDefaultPath
return output
end run
A continuación encontrará una captura de pantalla del editor de script después de la compilación sin la palabra compatibility
(al intentar compilar el código con esta palabra me da el mismo mensaje de error que el del principio de este post):
Sistema utilizado:
- MacOS Catalina 10.15.5
- MacBook Pro (13", 2019, Core i7 de Intel de cuatro núcleos a 2,8 GHz, 16 GB de RAM, gráficos Intel Iris Plus 655 de 1536 MB)
- Microsoft Word Versión 16.39 (20071300)
- ScriptEditorial Versión 2.11 (208)
- Versión 2.10 de Automator (492)