Hello,
This simple Applescript
tell application "Finder"
open file "a907.jpg" of folder "Photoshopped" of folder "CalBodfish" of folder "Users" of disk "Macintosh HD"
end tell
results in an error that says
The file "a907.jpg" couldn't be opened because you don't have permission to view it. To view or change permissions, select the item in the Finder and choose File > Get Info.
This script worked as expected in previous versions of macos, at least thru 12.0.
If the file is opened by double-clicking on it, the Applescript works as expected, for that particular file.
Much obliged if anyone here can help.
-
—
Crudgle
Add a CommentI'm having the same problem. I created a fresh, vanilla plain text file in TextEdit. Then ran this code:
set open_this to "MyMac:Users:MyHome:Desktop:MyTest.txt" tell application "Finder" to open open_thisI get this error: "The document "MyTest.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"
So, I switched to this code:
set open_this to "/Users/MyHome/Desktop/MyTest.txt" tell application "System Events" to open file open_thisThat produced a new error: "The document "/Users/MyHome/Desktop/MyTest.txt" could not be opened. The file does not exist."
This seems to be a variant of the bug in macOS 12.3 which prevented using Finder to open files from within AppleScript. Switching to system Events was a workaround but now, even that is not working.