gpt4 book ai didi

macos - Applescript 制作新文件夹

转载 作者:行者123 更新时间:2023-12-05 08:13:32 25 4
gpt4 key购买 nike

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

为什么这个脚本不起作用?

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 更直接地做到这一点:

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

关于macos - Applescript 制作新文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4493335/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com