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

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

问题描述

怎样才能打开在同一文件夹中的AppleScript code文件?沿着这些线路的东西吗?

 告诉应用程序QuickTime播放器
    启用
    打开文件.avi
告诉结束

(不工作)。
谢谢!


解决方案

 告诉应用程序发现者
    文件夹中打开文件somefile.txt(文件(路径为我))
告诉结束

(一旦你保存脚本仅适用 - 否则道路我去脚本编辑器)

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天全站免登陆