小编Reu*_*ben的帖子

通过Applescript将文件添加到Xcode项目目标

我想自动将文件添加到从头创建的Xcode项目(通过另一个IDE)作为构建后步骤.我们的项目设置为调用在项目中生成相应文件引用的applescript,但是每次尝试将文件引用添加到项目都会失败.

核心问题似乎是这个错误:Xcode出错:工作区文档"project.xcworkspace"的项目"TestProject"的Xcode 3组ID"D82DCFB50E8000A5005D6AD8"的文件引用ID"DCDCC17E13819A8E004B4E75"不理解添加消息.

在这条线上:

add fileRef to first target of testProject
Run Code Online (Sandbox Code Playgroud)

其中fileRef是设置为新创建的文件引用的变量,testProject是设置为包含fileRef的项目的变量.

这是代码:

on run argv

-- Get the folder containing items to be added to the project
tell application "Finder"
    set thisScript to path to me
    set projectFolder to get folder of thisScript as string
    set sourceFolder to projectFolder & "FilesToAdd:"
end tell

-- Get all the files that will be added to Xcode
tell application "System Events"
    set filesToAddList to the name of every disk item of (sourceFolder …
Run Code Online (Sandbox Code Playgroud)

xcode applescript file add target

4
推荐指数
1
解决办法
3537
查看次数

标签 统计

add ×1

applescript ×1

file ×1

target ×1

xcode ×1