如何使用AppleScript从xcode项目中删除组

如何使用AppleScript从xcode项目中删除组,applescript,Applescript,我已成功地使用AppleScript将文件添加到组中,但我还需要能够删除子组。 我的想法是 tell currentGroup --remove any groups already present repeat with groupItem in groups --display alert " " & name of groupItem remove groupItem from groups end repeat end t

我已成功地使用AppleScript将文件添加到组中,但我还需要能够删除子组。 我的想法是

tell currentGroup
    --remove any groups already present
    repeat with groupItem in groups
        --display alert " " & name of groupItem
        remove groupItem from groups

    end repeat
end tell
但它告诉我,该容器不支持remove。
有什么想法吗?

我想出来了。要删除组中的所有组,我只需执行以下操作

删除当前组的组


不过,我不确定如何只删除一个组。

这可以通过以下方式实现:

tell application "Xcode"
tell front project
set parent_group to first group
delete first group of parent_group
end tell
end tell