In your screenshot I can’t see what is certainly the culprit.
on open draggeditems
repeat with currentFile in draggeditems
tell application "Image Events"
set openedFile to open (currentFile as alias) --<<<< I don't see the end of this instruction
set fileLocation to the location of openedFile
set fileName to the name of openedFile
If you are using (currentFile as alias) it’s not surprising that it fail.
Peavine carefully urged you to use
set openedFile to open file (currentFile as string)
because under Catalina, Image Events is unable to work with aliases.
I wish to add that, even if it worked in the past, the original syntax was bad too
draggeditems is a list of aliases
currentFile is an alias so, coercing it into an alias make no real sense.
In old times the correct syntax was : set openedFile to open currentFile
This version must work
on open draggeditems
tell application "Image Events" to launch
repeat with currentFile in draggeditems
tell application "Image Events"
set openedFile to open file (currentFile as string)
set fileLocation to the location of openedFile
set fileName to the name of openedFile
scale openedFile to size 800
save openedFile with icon
close openedFile
end tell
(*
tell application "Finder"
set the name of file fileName of fileLocation to ¬
(fileName)
end tell
*)
end repeat
end open
I guess that the two alternate versions listed below work too but I can’t test them under Catalina.
on open draggeditems
repeat with currentFile in draggeditems
tell application "Image Events" to launch
set POSIXPath to POSIX path of currentFile
tell application "Image Events"
set openedFile to open POSIXPath
set fileLocation to the location of openedFile
set fileName to the name of openedFile
scale openedFile to size 800
save openedFile with icon
close openedFile
end tell
(*
tell application "Finder"
set the name of file fileName of fileLocation to ¬
(fileName)
end tell
*)
end repeat
end open
on open draggeditems
tell application "Image Events" to launch
repeat with currentFile in draggeditems
set theFile to currentFile as «class furl»
tell application "Image Events"
set openedFile to open theFile
set fileLocation to the location of openedFile
set fileName to the name of openedFile
scale openedFile to size 800
save openedFile with icon
close openedFile
end tell
(*
tell application "Finder"
set the name of file fileName of fileLocation to ¬
(fileName)
end tell
*)
end repeat
end open
If it prove to work, the late one is my preferred choice because «class furl» is the class of object which is used now by most tools.
And of course, I’m always waiting your explanations about the three instructions which I deliberately disabled.
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) vendredi 22 mai 2020 18:15:37