Hi --
I'm trying to use AppleScript to access the Copy File Build Phases within an Xcode project, ultimately to automate the creation of some copy steps. My first pass at this is to write a script that discovers ones I already have, so I have this:
on _findTargetOfProject(aProjectFile) tell application "Xcode" activate open aProjectFile
set aProject to first item of projects set aTarget to first target of aProject
repeat with aCopy in every copy files phase of aTarget -- How to find the cfbp "caption" you see in Xcode, e.g. 'Copy Files' log "Copy Phase: " & (id of aCopy) & " --> {" & (destination directory of aCopy) & "}/" & (path of aCopy) end repeat
aTarget end tell end _findTargetOfProject
on run set aPrjFile to choose file set aTarget to _findTargetOfProject(aPrjFile)
end run
Output looks something like this, which looks right given my test Xcode project:
(*Copy Phase: 95BE16C108E10C94002BAA9B --> {wrapper}/*)
One thing I don't seem to be able to do is locate the "name" property for the cfbp element, I can see the ID, the destination directory, the path, the comments etc. but not the caption you see in Xcode (e.g. "Copy Files").
Does anyone know how to retrieve that? Better still, does anyone know how to enumerate the properties of any arbitrary AppleScript object? (using AppleScript)?
Thanks in advance!
|