Skip to main content
Participant
January 28, 2019
Question

Folder.userData is null?

  • January 28, 2019
  • 5 replies
  • 2149 views

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

This topic has been closed for replies.

5 replies

TᴀW
Legend
July 8, 2024

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.

Visit www.id-extras.com for powerful InDesign scripts that save hours of work — automation, batch tools, and workflow boosters for serious designers.
dbDavideBoscolo
Legend
August 29, 2024

If you are developing an extension you can use node.js to get the same information.

dbDavideBoscolo
Legend
August 3, 2023

Did you find a solution for this?

Stephen Marsh
Community Expert
Community Expert
August 3, 2023

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

Legend
February 1, 2019

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? )

Legend
January 30, 2019

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)

Kukurykus
Legend
January 30, 2019

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.

Kukurykus
Legend
January 28, 2019

On PC it returns: ~/AppData/Roaming. Documentation says on Mac it's for: ~/Library/Application Support

Participant
January 28, 2019

Yes that is what it should be doing. But why is it returning null is my question.  Is it some sort of permission issue?

Kukurykus
Legend
January 28, 2019

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.