2

我开始关注 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"
4

3 回答 3

3

您可以使用以下命令从正常路径获取文件对象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"
于 2013-04-23T15:41:14.870 回答
3

你会想做这样的事情......

tell application "Xcode"
    open file "path:to:my:file.xcodeproj"
end tell
于 2013-04-23T15:41:38.453 回答
0
    tell application "Xcode"
        open file "Macintosh HD:Users:YourUserName:YourFolder:YourFolder:YourFileProject.xcodeproj"
    end tell
于 2019-10-09T08:58:29.147 回答