【发布时间】:2011-08-09 22:16:20
【问题描述】:
如何打开 AppleScript 代码所在文件夹中的文件?类似的东西?
tell application "QuickTime Player"
activate
open "file.avi"
end tell
(这不起作用)。 谢谢!
【问题讨论】:
标签: applescript
如何打开 AppleScript 代码所在文件夹中的文件?类似的东西?
tell application "QuickTime Player"
activate
open "file.avi"
end tell
(这不起作用)。 谢谢!
【问题讨论】:
标签: applescript
tell application "Finder"
open file "somefile.txt" of folder of (file (path to me))
end tell
(仅在您保存脚本后才能使用 - 否则“我的路径”将转到脚本编辑器)
【讨论】:
file 之前的 path to me 不需要,但(至少从 OS X 10.8 开始) - path to me 返回一个 alias,其 folder(或 container)属性可以直接查询。