的AppleScript,使新的文件夹 [英] Applescript to make new folder

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

问题描述

我想在苹果脚本的新文件夹命令

为什么dosent这个脚本的工作?

 告诉应用程序发现者
启用
告诉结束
告诉应用程序系统事件
告诉进程发现者
    告诉菜单栏1
        告诉菜单栏项目文件
            告诉菜单文件
                点击菜单项新建文件夹
            告诉结束
        告诉结束
    告诉结束
告诉结束
告诉结束


解决方案

您可以使用AppleScript的更直接地做到这一点:

 告诉应用程序发现者
    设置p来的路径桌面 - 或者你想要的任何路径
    使新的文件夹在P具有属性{名字:新建文件夹}
告诉结束

I Want to make a new Folder command in apple script

Why dosent this script work?

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

解决方案

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天全站免登陆