2012-01-25 154 views
0

這可能是一個非常基本的問題;applescript:更新屬性?

我總是看到

make new document with properties { x: "1", y: "2", z: 3" } 

但我怎麼在以後更新這些屬性?

tell first document 

-- i am trying to set the volume name property 
set volume name of document to "BLA" 
-- also tried: 
set properties of first document to {volume name:"BLA"} 

end tell 

但這根本不起作用,官方語法是什麼?無法在線找到它。

回答

1

您將需要針對相應的文件(或任何具有財產),但屬性被訪問的方式與任何其他record財產一樣,比如

tell application "whatever" 
    set x of document 1 to "5" -- document 1 is usually the front document 
    tell document 1 to set x to "5" 
end tell 

注意,應用程序性能可能不可寫 - 檢查它的腳本字典。