2014-09-10 123 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'" 
相关问题