I have a plain text file saved to my Desktop the result of an earlier script. I have a simple AppleScript telling Finder to open the text file:
set open_this to (path to desktop as text) & "Test.txt"
tell application "Finder" to open alias open_this
This results in the error:
"The document "Test.txt" could not be opened. You don't have permission. To view or change permissions, select the item in the Finder and choose File > Get Info."
Weirdly, if I duplicate the text file and tell Finder to open it I get:
"Finder got an error: Handler can’t handle objects of this class."
I've check permissions on the file and they look normal – my user account has read & write permission.
I have given "Full Disk Access" to Script Debugger, my AppleScript IDE.
This was a known bug in macOS 12.3/12.3.1 and I thought it has been fixed in 12.4 when I tested the beta. But, it is definitely a bug in macOS 12.4.
Does anyone have a way in AppleScript of telling Finder to open a file ?