电子说
步骤1:将AppleScript图标添加到OSX菜单栏
在AppleScript编辑器内部(在OSX应用程序-实用工具中)转到首选项-常规,然后选中
[x]菜单栏中的显示脚本菜单
步骤2:将此脚本添加到用户脚本中
-- H.Zimmerman, AppleScript.
-- Create text file in current Finder folder with a dialog.
tell application “Finder”
try
display dialog “name of doc please (without the .txt thing)” default answer “”
set fileName to the text returned of result
if length of fileName = 0 then
return 0
end if
set fileExt to “.txt”
set thisFolder to the target of the front window as alias
set newFile to fileName & fileExt
make new file at thisFolder with properties {name:newFile, file type:“TEXT”, creator type:“ttxt”}
on error errMsg
display dialog (errMsg)
end try
end tell
步骤3:创建文本文件
在相应的 Finder 文件夹中,只需选择刚添加的菜单项,输入名称,文件即已存在。双击它将打开熟悉的文本编辑。
责任编辑:wv
全部0条评论
快来发表一下你的评论吧 !