I'm making a little Cocoa-Applescript application in Xcode, and I'm completely new at this. So my questions are:
- What are the steps, in order, to set an image into the ImageWell, if the image was named "Image.png"?
- What are the codes to add to the AppDelegate.applescript?
Any help is appretiated, and thanks in advance.
OK - when using the Interface Editor, you need to include outlet properties in your script that will represent the instances of the various UI objects. The Interface Editor will look for properties that have a specific signature, so the first thing is to add an outlet property to your script, set to missing value - for example:
property myImageWell : missing value
Once you have added (and saved) your script with the property, it will show up in the Interface Editor. The easiest way to start with would be to select the blue cube that represents your App Delegate, and look in the Connections Inspector to see all of the various connections - you should see the myImageWell property under Outlets. In the Inspector pane, there are connector symbols along the right side - click and drag a connection from the symbol for the myImageWell property to the image well in your user interface. Save the file and you are done - the actual propery values will be set when your application starts up.
That is the general procedure to connect things in your UI to the properties that represent them in your script (there are other goodies such as bindings, but this will get you started). Once connected, you can use the various methods of whatever class your object is an instance of (in this case an image well / NSImageView and its parents).