Copy link to clipboard
Copied
I'm having issues while creating File objects in Sierra:
var myFile = new File("/Users/myusername/Documents/Sample.jpg"); //Of course this file exists
Fails many times (File not found), but it seems not always or at least not in all computers
var myFile = new File("~/Documents/Sample.jpg");
works fine and myFile.fsName returns the full path as specified in the first option "/Users/myusername/Documents/Sample.jpg"
Something in Sierra's file system may have changed, one user reported he solved this by reinstalling OS.
To reproduce the error just enable script logs and try to place a picture in Photoshop, then execute the script with ExtendedScript, the path notation used in the log doesn't works.
Any help would be appreciated.
Copy link to clipboard
Copied
If it helps:
I have been able to reproduce it also at the new CC 2017 start screen, if I try to reopen a document from there it raises a scripting error. The same document opened at Photoshop's menu (recent list) opens fine.
As far as I know from my tests It affects only files saved into the Documents folder.
Copy link to clipboard
Copied
Hey MSSDedalus, I just ran a few tests on my system and everything seems to work fine, even opening from the Documents folder.
I also tried setting the new File as a variable before running the "Opn " ActionDescriptor, and it worked. I tested PSDs, PNGs and JPGs.
Here's what I'm running:
macOS Sierra 10.12.1
Photoshop 2015.0.0
It might be an issue with a new version of Photoshop? I don't have a 2015.5 or a 2017 version to test with, unfortunately.
Copy link to clipboard
Copied
Thanks for your answer.
I believe the problem is on how Photoshop File object reads the file path in Sierra for the users folder but as I mentioned it doesn't happens in all computers, really weird.
The issue has been reported by 2 users and I could also reproduce it with Sierra 10.12.1 and CC 2017.0.0
From my tests I know that the volume has to be included or "~/" must be used but results from scripting listener like "/Volumes/Users/MyUser/Documents/Sample.jpg" doesn't work.