Opening an image - "choose file" vs path with Image Events


#1

Hello,

When I open a jpg file on my desktop selected with “choose file” inside an Image Events tell block, the open command is successful. If I set the file reference to a file path, “Macintosh HD:Users:MyName:Desktop:myfile.jpg” I get a file not found error. I am using the (2nd code) example found here.

When inspecting the file reference “this_file” (from the 2nd example on the example) SD shows it as an alias. I tried using “as alias” but AS returns a “file - - - wasn’t found” error.

Thank you,

Tom N


(Shane Stanley) #2

You can’t use something like:

set theFile to file "Macintosh HD:Users:MyName:Desktop:myfile.jpg"

Use an alias instead:

set theFile to alias "Macintosh HD:Users:MyName:Desktop:myfile.jpg"