Re: Scripting adding files to a project
Re: Scripting adding files to a project
- Subject: Re: Scripting adding files to a project
- From: Rick Ballard <email@hidden>
- Date: Tue, 25 Oct 2005 18:42:59 -0700
There are two ways you can specify where to make a new object. First,
you can use a location specifier; for example:
make new foo at end of group bar
make new foo before file reference 2 of bar
etc
Second, you can use a tell block on the container:
tell group bar
make new foo
end
Saying "make new foo at group bar" does not presently work, at least
in cocoa scripting.
- Rick
On Oct 25, 2005, at 3:58 PM, Nathan Herring wrote:
I didn't have the "end of (file references) of" in there; I will
try it
with that. Does the "at" parameter generally require you to specify
the
beginning|end of the element section you're using? (or "before file
reference ID #####"?)
-nh
-----Original Message-----
From: Rick Ballard [mailto:email@hidden]
Sent: Tuesday, October 25, 2005 3:47 PM
To: Nathan Herring
Cc: email@hidden
Subject: 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:
This email sent to email@hidden