Can't get relative location of local files - "path to me as text " not working in Xcode

224 Views Asked by At

I have having real trouble getting the path of objects within my Xcode project - previously in another thread adayzdone suggested to use:

set parentDirectory to POSIX path of ((path to me as text) & "::")

Which works brilliantly... in Applescript Script Editor, but causes this error when included in my Applescriptobjc project in Xcode :

Can’t make «class ocid» id «data optr00000000609B220080600000» into type constant. (error -1700)

Still has me stumped!

1

There are 1 best solutions below

0
On

I worked it out.

set ImagePath to current application's NSBundle's mainBundle()'s bundlePath() as text & "/Contents/Resources/imageName.png"

Thanks.