Playing with AppleScript I am confused on what I am doing wrong when I try to call another AppleScript from the Scripts
folder. My current script is saved as foo.app
and I see the structure from the Bundle Contents
but when I try to call bar.app
from inside the Scripts
folder I get a dialog of Resource not found
.
After referencing "How to access from AppleScript a bundled file within a Cocoa-AppleScript Application?" I tried:
tell application "Finder"
set thisFolder to (container of (path to me)) as string
set insideApp to thisFolder & (path to resource "bar.app")
end tell
When that produced the error I did some more searching I referenced "How do I get the Scripts folder in the application bundle?" and tried:
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
Targeting description.rtfd
I display the variable thisFolder
and the dialog I get Macintosh HD:Users:darth_vader:Desktop:
but it produces Resource not found
when I run:
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
What exactly am I doing wrong and how do I call from within the Scripts
folder?