ios - 通过 applescript(osascript) 运行 Xcode

标签 ios xcode vim applescript

  • OSX 优胜美地
  • Xcode 7.1

我正在通过 vim 或 atom 开发 iOS。 但有件事我不喜欢。 必须按 command + tab 然后切换到 Xcode 才能运行。

我发现这个脚本可以解决这个问题。但效果不佳。

tell application "Xcode"
    activate
    tell application "System Events"
        perform (keystroke "r" using command down)
    end tell
end tell

或另一个 applescript。它也不起作用。

tell application "Xcode"
    activate

    set targetProject to project of active workspace document
    if (build targetProject) is equal to "Build succeeded" then
        launch targetProject
    end if
end tell

PLZ 帮助。

最佳答案

第一个脚本几乎是正确的,只是perform语法错误

activate application "Xcode"
tell application "System Events"
    tell process "Xcode"
        keystroke "r" using command down
    end tell
end tell

关于ios - 通过 applescript(osascript) 运行 Xcode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34780650/

相关文章:

iphone - 应用程序在 4.0 上崩溃但在 5.0 上没有

VIM:我怎么知道关键字使用了哪个突出显示规则?

vim - 如何在 Vim 中逐行而不是逐段滚动屏幕?

matrix - 设置vim背景透明

ios - 从 Swift 函数中的异步调用返回数据

ios - 在 iPhone 应用程序中打开 iBooks

ios - Swift 中的 ENSwiftSideMenu 阴影

xcode - 在场景中放置对象,SpriteKit

ios - SwiftUI 在没有按钮的情况下询问通知权限

xcode - Swift Sdtlib工具错误: Task failed with exit code 1