Iain Moncrief Iain Moncrief -4 years ago 172
Objective-C Question

How do I change an NSImageView object to its alternate image in Objective C applescript?

Using Xcode I am trying to change an image object to another image. I am using ObjC Applescript. I have an IB Outlet

testImage : missing value
and using
tell testImage to setImage("sample.png")
to change the image.

Answer Source

The following code should do the trick:

set image to current application's NSImage's imageNamed_("sample.png")
testImage's setImage_(image)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download