【发布时间】:2011-06-12 17:30:12
【问题描述】:
我在使用 AppleScript 将文件夹复制到 XCode 项目时遇到了一些问题。如果没有 Applescript,我将文件夹拖到 Xcode 中。
我使用了一个类似的 Applescript 处理程序,如下所示,使用“wrapper.library”作为文件类型将库复制到 XCode。下面我使用“wrapper.folder”尝试将文件夹复制到 XCode 中,但它不起作用。
on addFolder(fname, fpath)
tell application "Xcode"
tell project "Unity-iPhone"
set my_targets to targets
set s_target to item 1 of my_targets
set compile_phase to compile sources phase of s_target
set link_phase to get link binary with libraries phase of s_target
tell root group
set a to make new file reference with properties {full path:fpath & fname, name:fname, file type:"wrapper.folder"}
add a to link_phase
end tell
end tell
end tell
end addFolder
有人对我缺少什么或如何编写 Applescript 将文件夹复制到 XCode 有任何想法吗?
【问题讨论】:
-
这个 Xcode 插件可能会有所帮助:github.com/larsxschneider/Xcode-Scripting-Interface
-
我很想知道你是怎么解决这个问题的...
-
除了手动移动文件夹外,我从未找到解决方案。我知道这是可以做到的,因为我使用了可以移动文件夹的已编译 Applescript。
-
基于对这个问题的回答stackoverflow.com/questions/6022009/… Xcode AppleScript add 命令可能已损坏。
-
如果添加命令被破坏,编译后的 AppleScript 是否仍然能够将文件夹添加到 Xcode 项目中?
标签: iphone xcode applescript