使用AppleScript我試圖從Scripts
文件夾中調用另一個AppleScript時,我很困惑我做錯了什麼。我當前的腳本保存爲foo.app
,我看到Bundle Contents
的結構,但是當我嘗試從Scripts
文件夾中撥打bar.app
時,我得到一個對話框Resource not found
。Applescript指示嘗試在應用程序內部調用時找不到資源
引用後「How to access from AppleScript a bundled file within a Cocoa-AppleScript Application?」我想:
tell application "Finder"
set thisFolder to (container of (path to me)) as string
set insideApp to thisFolder & (path to resource "bar.app")
end tell
時所產生我做了錯誤的更多一些搜索我引用「How do I get the Scripts folder in the application bundle?」,並試圖:
tell application "Finder"
set thisFolder to (container of (path to me)) as string
set insideApp to (thisFolder as alias) & (path to resource "bar.app" in directory "Scripts")
end tell
瞄準description.rtfd
我顯示變量thisFolder
和對話框我得到Macintosh HD:Users:darth_vader:Desktop:
,但它運行時產生Resource not found
:
tell application "Finder"
set thisFolder to (container of (path to me)) as string
display dialog thisFolder
set insideApp to thisFolder & (path to resource "Contents:Resources:description.rtfd")
end tell
我究竟在做什麼錯誤,我該如何從Scripts
文件夾中調用?