0
点赞
收藏
分享

微信扫一扫

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


展示

源码

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 条评论