-1
此代码在打开的文件夹中创建一个新的html文件,然后告诉textedit打开它进行编辑。Applescript制作无法编辑的文件
tell application "Finder"
tell application "Finder" to set currentDir to (target of front Finder window) as text
make new file at currentDir with properties {name:"test.html"}
tell application "TextEdit"
activate
open ("test.html")
end tell
end tell
麻烦的是文字编辑与抱怨:
文件“的test.html”无法打开。您没有权限。
TextEdit有什么问题?
感谢您尝试帮助,但现在我得到一个对话框,说:“你确定你要修改的文件地点?' '就地修改文档可能会导致您丢失一些原始格式。你想先复制文件吗?' – aquagremlin 2014-09-13 18:05:37
原来这是一个文本编辑问题。我会发布一个新问题。 – aquagremlin 2014-09-13 19:38:20