想要将文件名作为参数传递给applescript

发布于 2025-02-11 18:37:44 字数 309 浏览 1 评论 0原文

我在applescript上挣扎。我什至无法编写一个简单的脚本,该脚本以文件名并在适当的应用程序中打开它。

我尝试了一下:

on run argv
    tell application "MindNode"
        open file (item 1 of argv)
    end tell
end run

这给了我:

osascript test.scpt dysfunctions.mindnode
missing value

非常感谢帮助。

I struggle greatly with AppleScript. I cannot even write a simple script that takes a filename and opens it in the appropriate app.

I tried this:

on run argv
    tell application "MindNode"
        open file (item 1 of argv)
    end tell
end run

This gives me:

osascript test.scpt dysfunctions.mindnode
missing value

Very grateful for assistance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文