【发布时间】:2017-06-27 07:56:42
【问题描述】:
我有一个已编译的 AppleScript 应用程序,已移动到我的 Windows 服务器。然后我想在应用程序中插入一个文本文件(在 Windows 上看起来像一个 zip 文件):
myapplescript.app/Contents/Resources/MyNewDir/MyTxtFile.txt
所以,我已经预编译了 AppleScript 以尝试从该文本文件中读取并将内容作为字符串获取。我就是这样做的:
set theFolder to POSIX path of (the path to me)
set theFile to theFolder & "Contents/Resources/MyNewDir/MyTxtFile.txt"
open for access theFile
set fileContents to (read theFile)
close access theFile
但这是我得到的错误:
做不到 “/Users/mike/Desktop/myapplescript.app/Contents/Resources/MyNewDir/MyTxtFile.txt” 进入类型文件
【问题讨论】:
标签: file-io applescript