Link in Zwischenablage kopieren
Kopiert
Hi,
I have a simple script which I am trying to get the value of the the userData attribute to write a file. Any idea why Folder.userData on Mac Mojave system would return null? This on a Mac Mojave system (10.14.2)
Thanks in advance, Scott
Link in Zwischenablage kopieren
Kopiert
On PC it returns: ~/AppData/Roaming. Documentation says on Mac it's for: ~/Library/Application Support
Link in Zwischenablage kopieren
Kopiert
Yes that is what it should be doing. But why is it returning null is my question. Is it some sort of permission issue?
Link in Zwischenablage kopieren
Kopiert
For PC there is wrote: %USERDATA% (by default, C:\Documents and Settings\username\Application Data)
I have no idea what's equivalent for %USERDATA% on OSX, but if there is some, see what it returns, used directly form SO.
Link in Zwischenablage kopieren
Kopiert
There isn't one for Mac. Closest is $HOME but that will only get you: /Users/scott
Link in Zwischenablage kopieren
Kopiert
Folder.userData should resolve to ~/Library/Application Support/ (or if you get it as URL ~/Library/Application%20Support)
What you could do is get ExtendScript Toolkit, and hook it up with your Photoshop version, and run (for example) the following script:
alert(Folder.userData)
Photoshop should then come to the foreground and display an alert containing the path.
It is, however, possible that the error is caused by Apple's messing around with interapplication communication in 10.14 (and it is getting worse and worse with every new version)
Link in Zwischenablage kopieren
Kopiert
I am on PC but when once I wanted to adjust script for OsX user I found there is problem with Folder.startup as well.
Link in Zwischenablage kopieren
Kopiert
Doesn't look like ExtendScript Toolkit works with modern versions of MacOS. I did create a simple script which has the alert(Folder.userData) and placed into the scripts directory. When I run it from Photoshop CC 2019 on macOS Mojave it returns "null".
I've even went into the Mac's Privacy settings and:
- verified accessibility was enabled
- gave Photoshop CC 2019 full disk access
Link in Zwischenablage kopieren
Kopiert
I have 10.14 on a virtual machine, and I will check it out shortly.
However, what happens when you run the script directly from ExtendScript Toolkit (and not saved and out of Photoshop)?
Link in Zwischenablage kopieren
Kopiert
You can also try.
alert(Folder.userData + "\n\n" + $.getenv("APPDATA"));
Only I do not know the analogue of the name "APPDATA" for MacOS
Maybe you know? )
Link in Zwischenablage kopieren
Kopiert
Did you find a solution for this?
Link in Zwischenablage kopieren
Kopiert
It works for me
alert(Folder.userData);
// or
alert(Folder.userData.fsName);
// or
alert(Folder.userData.fullName);
~/Library/Application%20Support
/Users/username/Library/Application Support
~/Library/Application Support
Ps 2021 on Monterey 12.6.8 Intel Chip
Link in Zwischenablage kopieren
Kopiert
The issue seems to be when the user is using OneDrive to backup their desktop. I've also seen this with users that are using Sharepoint.
In those cases, all the Folder paths in Extendscript return null.
Link in Zwischenablage kopieren
Kopiert
If you are developing an extension you can use node.js to get the same information.
Weitere Inspirationen, Events und Ressourcen finden Sie in der neuen Adobe Community
Jetzt ansehen