我开始关注 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"
我开始关注 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"
您可以使用以下命令从正常路径获取文件对象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"
你会想做这样的事情......
tell application "Xcode"
open file "path:to:my:file.xcodeproj"
end tell
tell application "Xcode"
open file "Macintosh HD:Users:YourUserName:YourFolder:YourFolder:YourFileProject.xcodeproj"
end tell