• 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
Using AppleScript to access a Copy File Phase in an Xcode project
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using AppleScript to access a Copy File Phase in an Xcode project


  • Subject: Using AppleScript to access a Copy File Phase in an Xcode project
  • From: Dave McCaldon <email@hidden>
  • Date: Wed, 21 Sep 2005 10:33:00 -0400


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!



 _______________________________________________
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: Using AppleScript to access a Copy File Phase in an Xcode project
      • From: Scott Tooker <email@hidden>
    • Re: Using AppleScript to access a Copy File Phase in an Xcode project
      • From: Daniel Jalkut <email@hidden>
    • Re: Using AppleScript to access a Copy File Phase in an Xcode project
      • From: Daniel Jalkut <email@hidden>
  • Prev by Date: Re: How do we debug a loadable bundle library in XCode?
  • Next by Date: Re: How do we debug a loadable bundle library in XCode?
  • Previous by thread: Re: OT: Where are the Icons Xcode uses..?
  • Next by thread: Re: Using AppleScript to access a Copy File Phase in an Xcode project
  • Index(es):
    • Date
    • Thread