Applescript to launch file from current folder?

て烟熏妆下的殇ゞ 提交于 2019-12-30 09:54:09

问题


How does one open a file in the same folder as the AppleScript code? Something along these lines?

tell application "QuickTime Player"
    activate
    open "file.avi"
end tell

(which doesn't work). Thanks!


回答1:


tell application "Finder"
    open file "somefile.txt" of folder of (file (path to me))
end tell

(only works once you've saved the script - otherwise "path to me" goes to the script editor)



来源:https://stackoverflow.com/questions/7003699/applescript-to-launch-file-from-current-folder

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!