Skip to content

Instantly share code, notes, and snippets.

@fjolnir
Created January 23, 2012 04:09
Show Gist options
  • Save fjolnir/1660529 to your computer and use it in GitHub Desktop.
Save fjolnir/1660529 to your computer and use it in GitHub Desktop.
Xcode 4 applescript woes
tell application "Xcode"
set proj to last project
set conf to build configuration "Debug" of proj
build proj using conf with transcript
-- Just returns a 'missing value'
end tell
@fjolnir
Copy link
Author

fjolnir commented Jan 23, 2012

tell application "Xcode"
    tell active workspace document
        set projs to get every project
        repeat with proj in projs
            set targ to active target of proj
            set conf to default build configuration type of proj
            build proj using conf
        end repeat
    end tell
end tell

@fjolnir
Copy link
Author

fjolnir commented Jan 23, 2012

tell application "Xcode"
    get every project of active workspace document
        --> {project "GLMath" of workspace document "Tranquil.xcodeproj/project.xcworkspace", project "Tranquil" of workspace document "Tranquil.xcodeproj/project.xcworkspace"}
    get active target of project "GLMath" of workspace document "Tranquil.xcodeproj/project.xcworkspace"
        --> target id "C70EA30214AC9780009D29C6" of project "GLMath" of workspace document "Tranquil.xcodeproj/project.xcworkspace"
    get default build configuration type of project "GLMath" of workspace document "Tranquil.xcodeproj/project.xcworkspace"
        --> build configuration type id "C70EA30614AC9780009D29C6" of project "GLMath" of workspace document "Tranquil.xcodeproj/project.xcworkspace"
    build project "GLMath" of workspace document "Tranquil.xcodeproj/project.xcworkspace" using build configuration type id "C70EA30614AC9780009D29C6" of project "GLMath" of workspace document "Tranquil.xcodeproj/project.xcworkspace"
        --> missing value
    get active target of project "Tranquil" of workspace document "Tranquil.xcodeproj/project.xcworkspace"
        --> target id "C7E2EF1C14B78D4C0000884E" of project "Tranquil" of workspace document "Tranquil.xcodeproj/project.xcworkspace"
    get default build configuration type of project "Tranquil" of workspace document "Tranquil.xcodeproj/project.xcworkspace"
        --> build configuration type id "C7E2EF3A14B78D4D0000884E" of project "Tranquil" of workspace document "Tranquil.xcodeproj/project.xcworkspace"
    build project "Tranquil" of workspace document "Tranquil.xcodeproj/project.xcworkspace" using build configuration type id "C7E2EF3A14B78D4D0000884E" of project "Tranquil" of workspace document "Tranquil.xcodeproj/project.xcworkspace"
        --> missing value
end tell
Result:
missing value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment