21 Replies Latest reply on Aug 5, 2016 3:51 AM by tpk1982

    Application Preference

    tpk1982 Level 4

      Hi,

       

      I need to change preference as shown below. But not able to found all in extendscript object model viewer.

       

      Screen Shot 2016-08-02 at 4.12.38 PM.png

       

      Could you please suggest someone.

       

      Thanks,

      K

        • 2. Re: Application Preference
          Laubender Adobe Community Professional & MVP

          Hi tpk1982,

          just a hint: "Smart Text Reflow" is the property smartTextReflow and is hiding within TextPreferences.

          Could be set by app or document.

           

          Better search here than in the OMV:

          InDesign ExtendScript API (11.0)

           

          Regards,
          Uwe

          1 person found this helpful
          • 3. Re: Application Preference
            tpk1982 Level 4

            Thanks Uwe, its really helpful. Just want to make sure, is it we get all the preference as i noted? Or something can't get?

            • 4. Re: Application Preference
              Laubender Adobe Community Professional & MVP

              Out of my memory:

              "Automatically Use Correct Optical Size" could be missing in the DOM.

               

              Uwe

              • 5. Re: Application Preference
                tpk1982 Level 4

                Thanks Uwe.

                 

                No i found "Automatically Use Correct Optical Size"  using useOpticalSize

                 

                Screen Shot 2016-08-03 at 4.21.48 PM.png

                • 6. Re: Application Preference
                  Level 1

                  function myDocment_Preference(myDoc)

                  {  

                      // General Points

                      document.textPreferences.smartTextReflow = false;

                      document.documentPreferences.allowPageShuffle = true;

                      document.textPreferences.kerningKeyIncrement = 2;     // Key_board kerning value seted by  2   

                      document.textPreferences.typographersQuotes=true;  

                      document.textPreferences.highlightSubstitutedFonts=true;  

                      document.textPreferences.baselineShiftKeyIncrement = 2;                // BaselineShiftKeyIncrement

                      document.textPreferences.leadingKeyIncrement = 2;                // leadingKeyIncrement   

                      document.textPreferences.useParagraphLeading = true; //     Tutn on the paragraph leading in the application file

                      document.textPreferences.useOpticalSize = true; //     Use optical size

                      document.textPreferences.abutTextToTextWrap = true; 

                      document.textPreferences.useParagraphLeading = true;

                      // Automatically Use Correct Optical Size

                      app.generalPreferences.previewSize = PreviewSizeOptions.MEDIUM; 

                      with(document.viewPreferences)

                          {

                              horizontalMeasurementUnits = MeasurementUnits.picas;    // Ruler Units, horizontal

                              verticalMeasurementUnits = MeasurementUnits.picas;        // Ruler Units, vertical

                              cursorKeyIncrement = 0+"p"+1;        // Ruler Units, vertical

                           }  

                      with (app.textEditingPreferences)

                          {

                              smartCutAndPaste = true;    // Adjust Spacing Automatically when Cutting and Pasting Words

                              tripleClickSelectsLine = true;

                              allowDragAndDropTextInStory = true;    // Enable in Story Editor

                              singleClickConvertsFramesToTextFrames= true;

                          }

                         alert ("Document Preference Updated")

                  }  // End Document Preference

                  1 person found this helpful
                  • 7. Re: Application Preference
                    tpk1982 Level 4

                    Thanks sreekarthik.. if you have other preference codings..please share.. am not started yet to code me personally for my needs.. so it will save my time

                    • 8. Re: Application Preference
                      tpk1982 Level 4

                      Am not able to find the below preference.. could please help to sort out

                       

                      Untitled-2.jpg

                      • 9. Re: Application Preference
                        tpk1982 Level 4

                        Any suggestions is appreciated. Really breaking my heads to find this one.

                        • 11. Re: Application Preference
                          tpk1982 Level 4

                          KS, i want the DOM for the above screenshot.. anyhow thanks for your answer

                          • 12. Re: Application Preference
                            karthiks94217840 Level 2
                            1 person found this helpful
                            • 13. Re: Application Preference
                              tpk1982 Level 4

                              thanks Karthik... am afraid the above option is not available in the DOM..

                              • 14. Re: Application Preference
                                karthiks94217840 Level 2

                                Hi,

                                 

                                I am try to got your answer. once i got the answer immediately i will post you.

                                 

                                Thanks

                                KS

                                • 15. Re: Application Preference
                                  Peter Kahrel Adobe Community Professional & MVP

                                  > Really breaking my heads to find this one.

                                   

                                  Scripting the preferences has always been a problem because not all preferences are scriptable and because the script names of preferences properties often bear no relation at all to the names in the Preferences window. For example, if you want to script the appearance of aspects of the story editor, in the interface you go to the Story Editor Display section. Who'd have thought that in the DOM you need to look for app.galleyPreferences.

                                   

                                  A while ago when I was looking for some preferences names in the DOM I got fed up and wrote a script so that I could search for value names rather than property names. The script, below, prints the attribute names and their values of all Preferences, Settings, and Options. So to find the story-editor things, I looked for Gothic, rather than trying to double-guess Adobe's ideas on how to name its interface attribute name in the DOM. (The divergences to some extent reflect the different generations of Adobe engineers working on InDesign, so some degree of inconsistency is to be expected.)

                                   

                                  Here's the script. It places a file on the computer's desktop and opens it. To find the property 'Number of recent fonts to display', set it in the interface to some value, e.g. 12, then

                                   

                                  (function () {
                                  
                                      var list = [];
                                  
                                      var skip = { // Not interested in these
                                          'isValid': true,
                                          'parent': true,
                                          'properties': true,
                                          'events':  true,
                                          'eventListeners':  true,
                                          'isValid': true
                                      }
                                  
                                      // Print a name such as SINGLE_LINE rather than a long meaningless number
                                      function getValue () {
                                          if (x instanceof Enumerator) {
                                              return String (x);
                                          }
                                          return x;
                                      }
                                  
                                  
                                      function getPreferences (category, props) {
                                          list.push (category+'\r----------------------------------------');
                                          for (var i in props) {
                                              if (!skip[i]) {
                                                  try {
                                                      list.push (i + ': ' + getValue(props[i]));
                                                  } catch (_) {
                                                      list.push (i + ': ???');
                                                  }
                                              }
                                          }
                                          list.push ('=======================================')
                                      }
                                  
                                      function createList () {
                                          var re = /Preferences|Settings|Options/;
                                          // Choose the application's or the document's preferences
                                          var p = app.properties;
                                          //var p = app.documents[0].properties;
                                          for (var i in p) {
                                              if (re.test(i)) {
                                                  getPreferences (i, p[i]);
                                              }
                                          }
                                      }
                                  
                                      function main () {
                                          createList();
                                          var f = File ('~/Desktop/InDesign_preferences.txt');
                                          f.encoding = 'UTF-8';
                                          f.open ('w');
                                          f.write (list.join('\r'));
                                          f.close();
                                          f.execute();
                                      }
                                  
                                      main();
                                      
                                  }());
                                  
                                  • 16. Re: Application Preference
                                    tpk1982 Level 4

                                    Hi Peter,

                                     

                                    First a BIG THANKS for sharing this script...

                                     

                                    It initially give the report all values with "???" But i change the line 15 like below then it gives all values    

                                     

                                        function getValue (x) {  
                                    

                                     

                                     

                                    But the sad thing is again i am not able to find the requirement of 'Number of recent fonts to display' even after changing values

                                     

                                    I tried both var p = app.documents[0].properties; and var p = app.documents[0].properties;

                                     

                                    Thanks,

                                    Karthi

                                    • 17. Re: Application Preference
                                      Peter Kahrel Adobe Community Professional & MVP

                                      Sorry about that x, don't know what happened to it.

                                       

                                      That you're not able to find the script equivalent of 'Number of recent fonts to display' means that it's not scriptable. As was mentioned earlier, not everything in the Preferences is scriptable. If you feel strongly about this, file a feature request.

                                       

                                      Peter

                                      • 18. Re: Application Preference
                                        tpk1982 Level 4

                                        Thanks Peter and everyone who are answer this thread...

                                        • 19. Re: Application Preference
                                          tpk1982 Level 4

                                          Sorry to iterate this thread...

                                           

                                          for curiosity...

                                           

                                          is it possible to load the preference settings from template?

                                          • 20. Re: Application Preference
                                            Laubender Adobe Community Professional & MVP

                                            From template?
                                            What kind of template would that be?
                                            Document preferences applied to a document, so that the template would be an InDesign document?

                                             

                                            Something for you below where Stephan Moebius did some "templates" for his purposes. He also discussed one aspect with Harb's script at InTools, using XML, for saving and loading the preferences. Discussion in German at hilfdirselbst.ch.

                                             

                                            Note:

                                            For InDesign CS5.5 ( all available settings for preferences he claimed; I did not test that at all ) and CS6 (some settings are missing):

                                             

                                            Indesign Voreinstellungen/Preferences/Defaults per Skript

                                            Stephan Moebius | September 18th 2012

                                             

                                            CS5.5:

                                            http://www.hilfdirselbst.ch/gforum/gforum.cgi?post=501015#501015

                                            CS6:

                                            http://www.hilfdirselbst.ch/gforum/gforum.cgi?post=505415#505415

                                             

                                            Regards,
                                            Uwe

                                            • 21. Re: Application Preference
                                              tpk1982 Level 4

                                              HI Uwe,

                                               

                                              Yes i thought some thing we do like importStyles... We keep one indesign with the desired preference in desktop and load those by calling from script..

                                               

                                              Thanks,

                                              Karthi