我有一个已编译的 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”转换为类型文件