Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Applescript to launch file from current folder?

Tags:

applescript

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!

like image 362
Rio Avatar asked Aug 09 '11 22:08

Rio


1 Answers

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)

like image 77
Flambino Avatar answered Oct 24 '22 21:10

Flambino