Can't make current application into type image [load image]

I get this error message when I am trying to load an image into an image view:

Here’s the path to the image that I am passing:

/Users/steve/Documents/ImageManagerDeluxe/tempJPEGFolder/HA070107_PH_MensHealth1.jpg’

Here’s the code in AS-S:

set image of image view “imageDrop” to load image (quoted form of POSIX path of newFileName)

and the error message:

Can’t make current application into type image

Edit: I should mention that using choose file drops the image in the image view

Any help would be appreciated

Hi RIRedinPA

couple of ideas for you to try.

on clicked theObject
	if name of theObject is "getpic" then
		set Choice to "Macintosh HD:Users:steve:Documents:ImageManagerDeluxe:tempJPEGFolder:HA070107_PH_MensHealth1.jpg'"
		set TheImage to load image (POSIX path of Choice)
		set image of image view "imageDrop" of window "main" to TheImage
	else if name of theObject is "delete" then
		delete image of image view "imageDrop" of window "main"
	end if
end clicked

or a user choice version:

on clicked theObject
	if name of theObject is "getpic" then
		set userChoice to (choose file with prompt "Choose a file " without invisibles)
		set TheImage to load image (POSIX path of userChoice)
		set image of image view "imageDrop" of window "main" to load image userChoice
	else if name of theObject is "delete" then
		delete image of image view "imageDrop" of window "main"
	end if
end clicked

Don’t use quoted form for this.

Hi,

As a follow-up to Bruce’s comment, here’s what I used in an application that loads an image file of my choice from a folder of images if the album art of iTunes is missing.


set theFile to (imageFile as string) as file specification
set newImage to load image (theFile)

I hope the above helps.

Good luck.

archseed :slight_smile:

load image: