Applescript 我可以使用apple脚本或automator将.doc自动转换为.htm吗?
如我所见,在automator中,没有将.doc文件转换为.htm、“转换Word文档格式”的方法,也没有将其另存为.htm和forApplescript 我可以使用apple脚本或automator将.doc自动转换为.htm吗?,applescript,automator,Applescript,Automator,如我所见,在automator中,没有将.doc文件转换为.htm、“转换Word文档格式”的方法,也没有将其另存为.htm和for 我也没有看到它(是的。unix命令行实用程序“textutil”可以做到这一点。类似于这样。请注意,由于您正在转换为html,因此在写入文件之前,我们可以使用命令行实用程序“tidy”清理html代码 set docFile to choose file do shell script "/usr/bin/textutil -stdout -format doc
我也没有看到它(是的。unix命令行实用程序“textutil”可以做到这一点。类似于这样。请注意,由于您正在转换为html,因此在写入文件之前,我们可以使用命令行实用程序“tidy”清理html代码
set docFile to choose file
do shell script "/usr/bin/textutil -stdout -format doc -convert html " & quoted form of POSIX path of docFile & " | /usr/bin/tidy -ib -utf8 -output " & quoted form of POSIX path of ((docFile as text) & ".html")
您可以在AppleScript中执行此操作:
tell application "Microsoft Word"
save as active document file name "converted.html" file format format HTML
end tell
文件名应该是使用旧式Mac路径创建的文件的路径,例如Macintosh HD:Users:someone:Desktop:converted.html