我想将当前打开的文件保存为 .doc 覆盖当前文件.. 所以我必须找到当前打开的文档路径,然后将当前文件保存在同一路径上,另存为 .doc
任何人都可以帮忙吗?我尝试了很多方法,但总是失败......(我在 OSX 10.6 上,第 09 页)
谢谢
我想将当前打开的文件保存为 .doc 覆盖当前文件.. 所以我必须找到当前打开的文档路径,然后将当前文件保存在同一路径上,另存为 .doc
任何人都可以帮忙吗?我尝试了很多方法,但总是失败......(我在 OSX 10.6 上,第 09 页)
谢谢
试一试:
tell application "Pages" to tell document 1
set oldname to name
set oldPath to get path
try
set docPath to oldPath
on error
set oldPath to (path to documents folder as text) & oldname & ".pages"
save in oldPath
end try
tell application "System Events" to set oldPath to path of disk item oldPath
if oldPath ends with ":" then set oldPath to text 1 thru -2 of oldPath (* useful is the app saves as packages *)
set docPath to text 1 thru -(1 + (count of "Pages")) of oldPath & "doc"
save as "Microsoft Word 97 - 2004 document" in docPath
end tell
来源:MacScripter,所以你可能需要稍微摆弄一下。