Applescript 从当前文件夹启动文件? [英] Applescript to launch file from current folder?

查看:37
本文介绍了Applescript 从当前文件夹启动文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何打开与 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!

推荐答案

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)

这篇关于Applescript 从当前文件夹启动文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆