2014-09-10 60 views

回答

1

如果該文件夾存在,你得到它的路徑與搜索工具:

tell application "Finder" 
    set blankPage to (folder "Text files" of (path to desktop) as text) & ¬ 
     "text.txt" as alias 
end tell 

要創建一個空的文本文件,你可以使用Finder這樣的:

tell application "Finder" 
    set blankPage to make new file at folder "Text files" of (path to desktop) ¬ 
     with properties {name:"text.txt"} 
end tell 

使用殼更快的方式:

do shell script "> $HOME'/Desktop/Text files/text.txt'" 
相關問題