如何让 Xcode 使用 Applescript 构建和运行? [英] How do I get Xcode to build and run using Applescript?

查看:62
本文介绍了如何让 Xcode 使用 Applescript 构建和运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试让 Xcode 使用 Applescript 构建和运行我的项目.这与 How to build & 相同的问题使用 Applescript 运行 Xcode?,但我认为该答案可能已过时,因为它在我的机器上不起作用.我明白了:

I am trying to get Xcode to build and run my project using Applescript. This is the same question as How to build & run Xcode with Applescript?, but I think that answer may be out of date, since it doesn't work on my machine. I get this:

execution error: Xcode got an error: The specified object is a property, not an element. (-10008)

我还尝试了以下方法:

tell application "Xcode"
    build project "MyProject"
end tell

但它不会构建,它只是返回缺失值".

but it doesn't build, it just returns "missing value".

(使用 Xcode 4.0.1,OS X 10.6.8)

(Using Xcode 4.0.1, OS X 10.6.8)

我在尝试在 Xcode 中使用 Applescript 时遇到了很多麻烦;我找不到任何实际的文档(除了 Xcode 字典,它非常简洁),只是一些似乎不起作用的示例.任何帮助将不胜感激.

I've been having a huge amount of trouble trying to use Applescript with Xcode; I can't find any actual documentation (except the Xcode dictionary, which is very terse), just examples that don't seem to work. Any help would be appreciated.

推荐答案

我敢于猜测这是 Apple 的一个不完整的实现.字典指出 build 应该返回一个值,但没有返回任何内容,Xcode 什么也不做.下面的代码完全符合Dictionary,但也不行.

I'm going to venture to guess that this is an incomplete implementation on Apple's part. The Dictionary states that build is supposed to return a value, but nothing is returned and Xcode does nothing. The following code conforms to the Dictionary exactly, but it doesn't work either.

tell application "Xcode"
    set theProject to project 1
    set theBuildConfigType to build configuration type 2 of theProject -- "Debug"
    set projectBuilt to build theProject using theBuildConfigType without static analysis and transcript
end tell

这里是每个脚本调试器的语法仅供参考:

Just for reference here is the syntax per Script Debugger:

set theResult to build reference ¬
     static analysis boolean ¬
     transcript boolean ¬
     using build configuration type

这篇关于如何让 Xcode 使用 Applescript 构建和运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆