• 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
Removing items from a project using AppleScript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Removing items from a project using AppleScript


  • Subject: Removing items from a project using AppleScript
  • From: "Jim O'Connor" <email@hidden>
  • Date: Wed, 21 Jun 2006 10:41:14 -0500

Does XCode support removing files from a project through AppleScript? I keep getting internal script errors when I try to remove or delete anything.

Test case:
1. Create a carbon application project from the template project from XCode
2. Run the following script in the script editor, the comments tell the results of the commands

tell application "Xcode"
set testProject to first item of every project document
set rootGroup to root group of testProject
set sourcesGroup to every group of rootGroup whose name is "Sources"
set sourcesGroup to first item of sourcesGroup
set aFileToRemove to every file reference of sourcesGroup whose name is "main.c"
set aFileToRemove to first item of aFileToRemove


-- the following lines return
-- Xcode got an error: Target container does not support the remove event.


remove aFileToRemove from sourcesGroup
remove aFileToRemove from rootGroup
remove aFileToRemove from testProject


-- the following lines return
-- Xcode got an error: NSInternalScriptError
delete aFileToRemove

end tell

Jim O'Connor
 _______________________________________________
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: Removing items from a project using AppleScript
      • From: Gouri Jonnalagadda <email@hidden>
  • Prev by Date: Re: asm instruction CVTSI2SS fails to compile
  • Next by Date: Re: Removing items from a project using AppleScript
  • Previous by thread: Re: asm instruction CVTSI2SS fails to compile
  • Next by thread: Re: Removing items from a project using AppleScript
  • Index(es):
    • Date
    • Thread