Mac(二):AppleScript实现在当前位置创建文件

阅读 67

2022-07-14


展示

源码

tell application "Finder" to set currentFolder to insertion location as alias
set newfilename to ""
display dialog "请输入完整的文件名" default answer newfilename buttons {"取消", "确定"} default button 2
if button returned of result is "确定" then
set newfilename to text returned of the result
set currentFile to POSIX path of currentFolder & newfilename
do shell script "touch \"" & currentFile & "\";open \"" & currentFile & "\""
end if


精彩评论(0)

0 0 举报