Это работает для меня:
--this is for xcode 3.x
tell application "Xcode"
tell active project document
tell root group
--Note: Large folders make it seems that the script is hanging. Give it some time to list all items in the given folder.
make new file reference with properties {name:"My Desktop Folder", full path:(POSIX path of (path to desktop folder)), file type:"wrapper.folder"}
end tell
end tell
end tell
Код для Xcode 4 немного отличается
--this is for Xcode 4.x
tell application "Xcode"
tell project 1
tell root group
--Note: big folders make it seems that the application (not the script like in Xcode 3) is hanging. Give it some time to list all items in the given folder.
make new file reference with properties {name:"My Desktop Folder", full path:(POSIX path of (path to desktop folder)), file kind:"folder"}
end tell
end tell
end tell
Опция «копировать в папку назначения при необходимости» просто скопируйте файлыв проект (если их там еще нет), а затем сделайте ссылку на файл на скопированные файлы вместо оригинальных файлов.Вы можете сделать то же самое с помощью Finder или команды оболочки, такой как cp или ditto, а затем сделать ссылку на скопированные файлы.Тогда я бы не использовал полный путь, а относительные пути вместо этого.С относительными путями перемещение проекта в другую папку не доставит вам никаких проблем.