【问题标题】:How can i Enable About menu bar item with Applescript如何使用 Applescript 启用关于菜单栏项
【发布时间】:2013-11-23 20:23:07
【问题描述】:

我想知道如何在 applescript 上启用 About MyApplication 菜单栏项。这个我试过了

 tell application "System Events"
    tell process "MyApp"
        set AboutApplication to {}
        repeat with AboutApplication in AboutApplication
            try
                set frontmost to true
                set AboutApplication to enabled of menu item "About MyApp" of menu "Object" of menu bar item "Object" of menu bar 1
                if activeMenuItem is true then
                end if
            end try
        end repeat
    end tell
end tell

但我很确定它错了。

谁能告诉我如何启用它?

【问题讨论】:

    标签: applescript


    【解决方案1】:

    我认为你不能用 AppleScript 做到这一点。

    如果您正在创建 AppleScriptObjC 应用程序,则需要将适当的脚本添加到 About 菜单项并使用 XCode GUI 启用。

    如果您正在使用脚本编辑器编写一个简单的脚本并希望在另一个应用程序中启用一个菜单项,那将没有意义,因为该应用程序在该菜单项后面没有任何代码。即使您能够启用菜单项本身,如果您单击它也不会发生任何事情,或者充其量是崩溃。

    尝试这个没有意义。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-21
      • 1970-01-01
      • 2012-12-19
      • 1970-01-01
      相关资源
      最近更新 更多