As a complete newbie when it comes to AppleScript, I can’t understand what’s happening.
For example I want to open an image using Preview. I get a warning from Preview saying:
“The file “Feed Cover.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.”
Also, at the bottom of the script editor where it says “result” I get “missing value”.
But I can open the file manually.
And here’s what’s weird: if the file was just copied from another location to the destination (let’s say the destination is the Desktop) and I’ve never opened it on the Desktop, I get that error. Once I go and I manually open the file, it opens, and then if I run the script again, now it opens it without an issue…
Can someone explain what’s happening? It seems that opening the file “unlocks it”? What’s going on?
Another issue:
I’m trying to open a PSD file with Photoshop, but it doesn’t open it. When I try with Preview, it opens. Maybe the issue is that the app is inside a folder inside the Applications folder? So instead of being in the root of Applications, it’s Applications > Adobe Photoshop 2020 > Adobe Photoshop 2020.app
If that’s the issue, how can I reference it to the file inside the folder?
This is my code so far:
tell application "Adobe Photoshop 2020" to open "Users:dannywyatt:Desktop:Cover Artwork - BeatNameHere.psd"
Model: MacBook Pro (13-inch, Mid 2012)
AppleScript: 2.11 (208)
Browser: Firefox 99.0
Operating System: macOS 12