Skip to content

Instantly share code, notes, and snippets.

@tokyosheep
Last active April 28, 2024 01:16
Show Gist options
  • Select an option

  • Save tokyosheep/9513ddc9d55788e2e211a4c39e82a780 to your computer and use it in GitHub Desktop.

Select an option

Save tokyosheep/9513ddc9d55788e2e211a4c39e82a780 to your computer and use it in GitHub Desktop.
open cloud document on Photoshop
/*
this work as well.
I suppose cloud path has something type or pattern of string.
and the application detects cloud or local automatically.
*/
app.open(new File( "/cloud-content/tsukuda.psdc" ));
(function(){
var idOpn = charIDToTypeID( "Opn " );
var desc253 = new ActionDescriptor();
var iddontRecord = stringIDToTypeID( "dontRecord" );
desc253.putBoolean( iddontRecord, false );
var idforceNotify = stringIDToTypeID( "forceNotify" );
desc253.putBoolean( idforceNotify, true );
var idnull = charIDToTypeID( "null" );
/* here is filePath on cloud. the file is located in top hierarchy.
tsukuda.psdc is filename
on Mac OS, this filePath doesn't work "/c/cloud-content/repo:~/cloud-content/tsukuda.psdc"
adopting both OS, get rid of "/c/cloud-content/repo:" from you may get filePath from Script Event Listener
*/
desc253.putPath( idnull, new File( "/cloud-content/tsukuda.psdc" ) );
var idDocI = charIDToTypeID( "DocI" );
desc253.putInteger( idDocI, 59 );
var idtemplate = stringIDToTypeID( "template" );
desc253.putBoolean( idtemplate, false );
executeAction( idOpn, desc253, DialogModes.NO );
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment