2011-02-01 75 views
0

我想保存當前打開的文件的.DOC覆蓋當前文件.. 所以我必須要找到當前打開的文檔的路徑,然後保存當前文件在同一路徑上,保存爲.DOC頁,當前文件保存爲.doc和覆蓋當前文件

任何人都可以幫助嗎?我試過很多方法,但總是失敗... (我在OSX 10.6與09頁)

感謝

回答

0

給這個一掄:

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,所以你可能需要擺弄一下。