Image events question

I’m trying to read some exif and iptc info from jpeg files, but it seems like I’m doing something wrong from the beginning. I copied this script from some site but this_image is always missing value. I’m probably doing something wrong but I don’t understand what, can someone tell me what I’m doing wrong

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

set this_file to choose file
tell application "Image Events"
	-- start the Image Events application
	launch
	-- open the image file
	set this_image to open this_file
	-- perform the manipulation
	-- flip this_image with horizontal
	-- save the changes
	-- save this_image with icon
	-- purge the open image data
	--close this_image
end tell

Jan. The choose file command returns an alias, and Image Events in recent versions of macOS does not work with aliases. One solution is to coerce the alias to text as in the following:

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

set this_file to (choose file) as text
tell application "Image Events"
	-- start the Image Events application
	launch
	-- open the image file
	set this_image to open file this_file
	set theResolution to resolution of this_image -- just a test
	-- perform the manipulation
	-- flip this_image with horizontal
	-- save the changes
	-- save this_image with icon
	-- purge the open image data
	--close this_image
end tell

BTW, normally you do not need to tell a script with Image Events to use scripting additions.

Have you granted Image Events Full Disk Access in System Preferences → Security & Privacy? It could be a permissions issue.

Thank to both of you, it now works (it was the file name that needed to be changed)