• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Possible to add files even frameworks to project via AppleScript?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Possible to add files even frameworks to project via AppleScript?


  • Subject: Possible to add files even frameworks to project via AppleScript?
  • From: André Berg <email@hidden>
  • Date: Sat, 11 Jul 2009 21:48:23 +0200

Fellow Xcoders,


How can I add a framework (or file even) located on my local disk to an Xcode project via AppleScript?

I tried various things like treating the object I would like to add as alias, item reference, file reference 
or as plain "a reference to" (the AS version of a pointer) coupled with "contents of" (the AS version of de-referencing):

tell application "Xcode"
tell root group of front project
make new group with properties {name:"test"} -- this does succeed
add (POSIX file "/Developer/Library/Frameworks/SenTestingKit.framework" as alias)
end tell
end tell

or

tell application "Xcode"
add (POSIX file "/Developer/Library/Frameworks/SenTestingKit.framework" as file reference)
end tell

--  Result:
--  Can’t make file "Macintosh HD:Developer:Library:Frameworks:SenTestingKit.framework" into type file reference. (-1700)

or 

tell application "Xcode"
add (POSIX file "/Developer/Library/Frameworks/SenTestingKit.framework" as item reference)
end tell

--  Result:
--  Can’t make file "Macintosh HD:Developer:Library:Frameworks:SenTestingKit.framework" into type item reference. (-1700)

also 

tell application "Xcode"
add (POSIX file "/Developer/Library/Frameworks/SenTestingKit.framework" as item reference) to group "External Frameworks and Libraries" of front project
end tell


Do I need to add this framework via a "make" type of command? Or do I have to add it to a different reciever object? 
I noticed through trial and error (mostly "properties of" debugging and SD's uber helpful tell context info panes) that the 
inner dealings in project files are largely done with some kind of references (item or file references) and there's also classes to back that up.

By searching through the mailing list I discovered that the file reference type was considered weird in 2005 already – is it still that way? 

The dictionary (as always) is also quite slim on this. 

I am using Xcode 3.1.3, Mac OS X 10.5.7 and Script Debugger 4.5 btw.

Thanks for reading, folks!


Cheers,

André
 _______________________________________________
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

  • Follow-Ups:
    • Re: Possible to add files even frameworks to project via AppleScript?
      • From: Dmitry Markman <email@hidden>
  • Prev by Date: Re: Is it possible to automatically generate Xcode projects?
  • Next by Date: Re: Internal error with Core Data models
  • Previous by thread: Re: Is it possible to automatically generate Xcode projects?
  • Next by thread: Re: Possible to add files even frameworks to project via AppleScript?
  • Index(es):
    • Date
    • Thread