[英]Open a local file with applescript within application
我如何从AppleScript应用程序中打开文件? 我将它放在我的AppleScript应用程序的/Contents/Resources
中。 我想知道的是我会告诉实际的脚本要做什么?
要获取应用程序的路径,请使用path to me
命令并构建资源路径。 然后,您可以使用Finder使用默认程序打开文件,或者您可以告诉特定程序打开该文件。
set filepath to (path to me as string) & "Contents:Resources:file.ext"
tell application "Finder"
open alias filepath
end tell
--OR
tell application "Microsoft Word"
open alias filepath
end tell
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.