Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Applescript 我可以使用apple脚本或automator将.doc自动转换为.htm吗?_Applescript_Automator - Fatal编程技术网

Applescript 我可以使用apple脚本或automator将.doc自动转换为.htm吗?

Applescript 我可以使用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

如我所见,在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 -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