Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scripting adding files to a project



On Oct 25, 2005, at 9:57 AM, Nathan Herring wrote:

Does anyone have a working script that allows you to create new file
references and assign them to various targets? My attempts have met with
silent failure: no error reported, and no files added.

Sure; try something like this:

tell application "Xcode"
tell project "MyProject"
set newFileRef to make new file reference with properties {name:"foo.m", full path:"/tmp/foo.m"} at end of (file references) of group "A Source Group"
add newFileRef to target "MyTarget"
end tell
end tell


I'd be interested to see what you were trying that didn't work; if it wasn't correct, it probably should have given you an error.

I hope this helps.

	- Rick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden
References: 
 >Scripting adding files to a project (From: "Nathan Herring" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.