Photoshop: 21.0.1: jsx can't save document to path containing 'cloud-content'

  • 2
  • Problem
  • Updated 8 months ago
Adobe Photoshop version: 21.0.1 20191106.r.47 2019/11/06: 3152b481f18  x64
OS: Windows 10 64-бит
OS version: 10 or more 10.0.18362.329

sample jsx code
app.documents.add(100,100);
app.activeDocument.saveAs(new File( "C:\\cloud-content1\\asd.psd"));
The folder C:\cloud-content1\ exists and it's allowed to write in this folder.

Expected result: file saved to the specified path
Actual result: error, approximate translation of message is:
Can't save as "/cloud-countent1/asd.psd": file not found.

The same error occurs for many variations of the file path, such as C:\\cloud-content\\asd.psd", C:\\cloud-contentasdf\\asd.psd" and so on.


When saving manually from the Photoshop UI - works fine.
Photo of Serg

Serg

  • 22 Posts
  • 3 Reply Likes

Posted 8 months ago

  • 2
Photo of Serg

Serg

  • 22 Posts
  • 3 Reply Likes
Another strange result here. Change code as follows (just remove psd extension from the path)

app.documents.add(100,100);
app.activeDocument.saveAs(new File( "C:\\cloud-content1\\asd"));
then the file will be saved, but not in C:\cloud-content1 folder, but to the following path
C:\Users\User\Documents\Adobe\Деловые партнеры Photoshop Cloud\asd

Photo of Tom Ruark

Tom Ruark, Official Rep

  • 34 Posts
  • 15 Reply Likes
Take out the "1" it should be "cloud-content"
Photo of Serg

Serg

  • 22 Posts
  • 3 Reply Likes
You cannot save a cloud document, psdc, locally
No, in the remark above I saying not about cloud psdc, but about simple local psd.

Steps
* create PSD
* try to it to to local disk C:\ in the local folder called "cloud-content", so the path (local path, no cloud) will be C:\cloud-content\test.psd. Yes, it is a little bit strange name for the local folder, but why not?

app.documents.add(100,100);
app.activeDocument.saveAs(new File( "C:\\cloud-content\\asd.psd"));
* this code will throw an error.

Just again - no cloud functionality here at all, just trying to save local file, but due to "magic words" in the path the operation fails.

I also can replase saveAs call with tha AM-code (also without referencing any cloud-specific entities such as "cloudPSDFormat") - and it also will fail.


So how does a user backup cloud files?
No problem with this. You can "Save as" cloud psdc file as local psd file via the Photoshop UI or via the jsx code with document.saveAs (but you should specify the target path which is not containing "magic" word "cloud-content".




Photo of Tom Ruark

Tom Ruark, Official Rep

  • 34 Posts
  • 15 Reply Likes
Yes. I argued against this magic folder. But cloud-document at the root of any drive is not allowed for non psdc files.
Yes. I argued for that as well. "I want to save all my cloud docs locally. Let me iterate the cloud!" Hopefully, that will come soon!
Photo of David Converse

David Converse

  • 939 Posts
  • 275 Reply Likes
But these files can be moved in the Finder/Explorer, correct?
Photo of Tom Ruark

Tom Ruark, Official Rep

  • 34 Posts
  • 15 Reply Likes
@david? I'm not sure what you mean. I would NOT have a cloud-content (my mistake saying cloud-document above) folder at the root of any drive. There is a "local cloud" folder if you look at app.cloudWorkAreaDirectory. This is to store files locally that cannot be stored in the cloud. There is also a per document activeDocument.cloudWorkAreaDirectory (a place to put side car files for this document) and activeDocument.cloudDocument (tells you this document is in the cloud)
Photo of David Converse

David Converse

  • 939 Posts
  • 275 Reply Likes
Yeah this folder should be in userland. What I'm getting at is that cloud sync folders can be problematic. We see people wanting to work directly in a dropbox folder and then having problems, for example.