Search code examples
xcodeapplescriptxcode4.5

launch Xcode project using AppleScript


i am a beginning to regard AppleScript. i try to open the xcode project using Xcode. i have succeed to open the folder which contain the xcode project but not yet, the launch of the project using Xcode.any help please ?!

tell application "Finder" to open folder "workpace" of folder "Documents" of folder "user1" of folder "Users" of disk "Macintosh HD"

Solution

  • You can get file objects from normal paths with POSIX file:

    tell application "Finder"
        open POSIX file "/Users/username/Documents/workspace/workspace.xcodeproj"
    end tell
    

    This is slightly slower, but it works even if Finder is not responding:

    do shell script "open ~/Documents/workspace/workspace.xcodeproj"