【发布时间】:2014-08-14 19:37:19
【问题描述】:
有什么方法可以使用 AppleScript 创建目标副本。我正在使用下面的代码,但它显示错误:Xcode 出错:无法复制目标。
tell application "Xcode"
tell active workspace document
set firstProject to (get first project)
set firstTarget to (get second target of firstProject)
tell application "Xcode" to duplicate firstTarget
end tell
end tell
以上脚本用于当前在 Xcode 中打开的项目。
我有不同的方法来实现它,但不知道如何让它发挥作用。
-
打开一个 Xcode 项目
告诉应用程序“Finder” 打开 POSIX 文件“/Users/TestUser/Desktop/CoBranding/source/tet/test.xcodeproj” 结束告诉
-
选择一个特定的目标并选择它(保持专注)
告诉应用程序“Xcode” 告诉活动工作区文档 将 firstProject 设置为(获取第一个项目) 将 projectDirectory 设置为(获取 firstProject 的项目目录)
结束告诉 结束告诉 现在使用 Apple 脚本的系统事件按编辑菜单下的复制。
【问题讨论】:
标签: ios xcode cocoa-touch cocoa applescript