2 Replies Latest reply on Dec 16, 2017 12:10 PM by PeteBaumgartner

    JS - Photoshop CC - clear Show start workspace when no documents open preference

    PeteBaumgartner Level 1

      In Photoshop CC2015+  jsx script I want to turn off the General Preference - 'Show start workspace when no documents open' - but have not been able to find the property name.

       

      Can anyone help?

       

      Thanks.

       

      pjb

        • 1. Re: JS - Photoshop CC - clear Show start workspace when no documents open preference
          r-bin Level 5

          Try )

           

          set_app_prefs("generalPrefs", "welcomeScreen2", false);
          
          ////////////////////////////////////////////////////////////////////////////////////////////
          function set_app_prefs(pref_key, prop_key, value)
              {
              try
                  {
                  if (typeof(pref_key) == "string") pref_key = stringIDToTypeID(pref_key);
                  if (typeof(prop_key) == "string") prop_key = stringIDToTypeID(prop_key);
          
                  var d1  = new ActionDescriptor();
                  var d2 = new ActionDescriptor();
                  var r = new ActionReference();
          
                  r.putProperty( charIDToTypeID( "Prpr" ), pref_key );
                  r.putEnumerated( charIDToTypeID( "capp" ), charIDToTypeID( "Ordn" ), charIDToTypeID( "Trgt" ) );
                  d1.putReference( charIDToTypeID( "null" ), r );
          
                  d2.putBoolean( prop_key, value );
          
                  d1.putObject( charIDToTypeID( "T   " ), pref_key, d2 );
                  executeAction( charIDToTypeID( "setd" ), d1, DialogModes.NO );
                  }
              catch (e) { alert(e); }
              }