Applescript 制作新文件夹 [英] Applescript to make new folder

查看:57
本文介绍了Applescript 制作新文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在苹果脚本中创建一个新的文件夹命令

I Want to make a new Folder command in apple script

为什么这个脚本有效?

tell application "Finder"
activate
end tell
tell application "System Events"
tell process "Finder"
    tell menu bar 1
        tell menu bar item "File"
            tell menu "File"
                click menu item "New folder"
            end tell
        end tell
    end tell
end tell
end tell

推荐答案

你可以更直接地使用 AppleScript:

You can do it more directly with AppleScript:

tell application "Finder"
    set p to path to desktop -- Or whatever path you want
    make new folder at p with properties {name:"New Folder"}
end tell

这篇关于Applescript 制作新文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆