【问题标题】:Automator not working inside xcodeAutomator 在 xcode 中不起作用
【发布时间】:2023-03-07 20:31:01
【问题描述】:

我正在运行一个带有 applescript 的 automator,虽然它在 automator 内部工作,但从 xcode 运行时它会失败。 这是我的代码:

tell application "Xcode"
    set targetProjectPath to path of active workspace document
    set targetProjectPath to POSIX file (targetProjectPath & "/..") as string
    set targetProjectPath to POSIX path of targetProjectPath
    tell application "System Events"
        tell process "Xcode"
            click menu item "Save" of menu 0 of menu bar item "File" of menu bar 0
        end tell
    end tell
    return {targetProjectPath}
end tell

我正在尝试触发保存并将活动工作区的路径返回给我以便稍后做一些工作。 几天前我才开始做,如果真的很愚蠢,请原谅我。

【问题讨论】:

    标签: xcode macos xcode8 automator


    【解决方案1】:

    这真的很简单。我所需要的只是授予 xcode 访问权限,以便能够修改可访问性设置。代码运行良好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-22
      • 1970-01-01
      • 2021-04-24
      • 2011-10-12
      • 2013-09-29
      • 1970-01-01
      相关资源
      最近更新 更多