2011-08-09 25 views
5

如何打開與AppleScript代碼相同的文件夾中的文件?沿着這些線路的東西?AppleScript從當前文件夾啓動文件?

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

(這不起作用)。 謝謝!

回答

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

(一旦你保存腳本僅適用 - 否則「路徑我」進入腳本編輯器)

+0

那令人難以置信的工作。謝謝! – Rio

+0

太好了。雖然(至少OS X 10.8) - '我的路徑'返回一個'別名',其'文件夾'(或'容器')屬性可以直接查詢。 – mklement0

相關問題