I’m currently working on an app for a computer science class, and for part of it i’m trying to get the icon of the user’s selected iPod to show in a popup window in an Image View. the code that i have in place now is
set image of image view "iPodPic" to file "zPod:.VolumeIcon.icns"
i just put my iPod in for testing. Im not sure if i’m using the right code or if i simply cannot put an icns file in an image view. i currently get an error -1700 (can’t make data into the expected type).
any help would be appreciated,
Model: PowerBook G4
Browser: Safari 417.8
Operating System: Mac OS X (10.4)
Please refer to the text below which I pasted from AppleScript Studio Terminology Reference in Xcode. I am sure it will give you a good tip.
BTW, continually loading images from a file is not a good method because the memory gets tied up unless you free them in your script. It’s better to store your image the project’s Resources in Xcode. Please refer to the AppleScript Studio Terminology Reference for how to do it…it’s all there.
Here’s that snippet of document I mentioned above:
The following awake from nib handler is from the Image sample application, distributed with AppleScript Studio. The handler simply uses the load image command to load an image from the project. (The image is stored in the project’s Resources group and is named AboutBox.tiff.)
on awake from nib theObject
set image of image view “image” of window “main” to load image “AboutBox”
end awake from nib
If you continually load images and don’t free them, your application memory usage will increase. For information on how to free an image, movie, or sound, see the Discussion section of the load image command.
Sorry, I forgot how to enclose it in AppleScript window.