我开始关注AppleScript。我尝试使用Xcode打开xcode项目。我已经成功打开了包含xcode项目的文件夹,但还没有,使用Xcode启动项目。请帮忙吗?!
tell application "Finder" to open folder "workpace" of folder "Documents" of folder "user1" of folder "Users" of disk "Macintosh HD"
答案 0 :(得分:3)
你想要做这样的事......
tell application "Xcode"
open file "path:to:my:file.xcodeproj"
end tell
答案 1 :(得分:2)
您可以使用POSIX file
tell application "Finder"
open POSIX file "/Users/username/Documents/workspace/workspace.xcodeproj"
end tell
这稍慢,但即使Finder没有响应它也能正常工作:
do shell script "open ~/Documents/workspace/workspace.xcodeproj"
答案 2 :(得分:0)
tell application "Xcode"
open file "Macintosh HD:Users:YourUserName:YourFolder:YourFolder:YourFileProject.xcodeproj"
end tell