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 |