Skip to main content
greless
Inspiring
April 15, 2019
Question

How do I seted a new document default type

  • April 15, 2019
  • 1 reply
  • 647 views

hi everyone:

     I  want to the document type preset is "Default Photoshop Size"  when i'n going to  create a new document .how to setes Preferences?

Please help
I always make mistakes

var d = new ActionDescriptor();

        var d1 = new ActionDescriptor();

        d1.putBoolean(stringIDToTypeID("artboard"), false);

        d1.putString(stringIDToTypeID("preset"), "Default Photoshop Size");

        d.putObject(stringIDToTypeID("new"), stringIDToTypeID("Preferences"), d1);

        executeAction(stringIDToTypeID("set"), d, DialogModes.NO);

This topic has been closed for replies.

1 reply

Stephen Marsh
Community Expert
Community Expert
April 15, 2019

Not sure if this helps or not… Using xtools to convert an action entry returns this:

#target photoshop

cTID = function(s) { return app.charIDToTypeID(s); };

sTID = function(s) { return app.stringIDToTypeID(s); };

function newFromPreset() {

  function step1(enabled, withDialog) {

    if (enabled != undefined && !enabled)

      return;

    var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);

    var desc1 = new ActionDescriptor();

    var desc2 = new ActionDescriptor();

    desc2.putBoolean(sTID("artboard"), false);

    desc2.putString(sTID("preset"), "Default Photoshop Size");

    desc1.putObject(cTID('Nw  '), cTID('Dcmn'), desc2);

    desc1.putInteger(cTID('DocI'), 201);

    executeAction(cTID('Mk  '), desc1, dialogMode);

  };

  step1();

};

newFromPreset.main = function () {

  newFromPreset();

};

newFromPreset.main();

greless
grelessAuthor
Inspiring
April 16, 2019

I'm alse  just modify this code, so this is creating a new document, and I'm not going to create it, I'm going to create it with type “Default Photoshop Size”  when I want to create it。i don't know the preferences should be used in action manager。