如何告诉Applescript在与脚本相同的目录中打开文件

如何告诉Applescript在与脚本相同的目录中打开文件,applescript,Applescript,grait.spritebuilder目录与脚本位于同一目录中。我想我需要一条绝对路径,但我似乎无法让它工作。我试过适应这个建议,但运气不好。有什么想法吗?链接的答案应该有用。你把它放在一个查找块里了吗?像这样: tell application "SpriteBuilder" to activate tell application "SpriteBuilder" open "portrait.spritebuilder" end tell 谢谢这正是我需要的。 tell appli

grait.spritebuilder
目录与脚本位于同一目录中。我想我需要一条绝对路径,但我似乎无法让它工作。我试过适应这个建议,但运气不好。有什么想法吗?

链接的答案应该有用。你把它放在一个查找块里了吗?像这样:

tell application "SpriteBuilder" to activate
tell application "SpriteBuilder"
    open "portrait.spritebuilder"
end tell

谢谢这正是我需要的。
tell application "Finder"
    set myFolder to container of (path to me) as text
end tell

tell application "SpriteBuilder"
    activate
    open myFolder & "portrait.spritebuilder"
end tell