Im building my first app in Xcode using Applescript Objc - I have managed to get it to swap an image (in an outlet called imageViewOne) based on the code below:
-- Declarations
property ImagePath : missing value
property imageViewOne : missing value
property NSImage : class "NSImage"
property parent : class "NSObject"
-- set path as variable
set my ImagePath to "/Users/monkey/XCode/testapp/green.png"
set theImage to initWithContentsOfFile_(POSIX path of ImagePath) of alloc() of class "NSImage" of current application
setImage_(theImage) of imageViewOne
While this works, the problem is that I need to find a way to use a relative path, not "/Users/monkey/XCode/testapp/green.png" (the png is included in the XCode project).
Any help would be well received - as you can see I am new to this!
I worked it out.
Thanks.