【发布时间】:2013-09-12 04:12:34
【问题描述】:
如何从 applescript 应用程序中打开文件?我会把它放在我的 applescript 应用程序的/Contents/Resources 中。我想知道的是我会告诉实际脚本做什么?
【问题讨论】:
标签: macos applescript
如何从 applescript 应用程序中打开文件?我会把它放在我的 applescript 应用程序的/Contents/Resources 中。我想知道的是我会告诉实际脚本做什么?
【问题讨论】:
标签: macos applescript
要获取应用程序的路径,请使用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
【讨论】: