36 Replies Latest reply on Mar 23, 2017 9:36 AM by Marc Autret

    Search document for SpecialCharacters Enumerator

    TᴀW Adobe Community Professional & MVP

      Hi,

       

      I've placed a Word document that has loads of irritating Unicode markers

      (left-to-right etc.)

       

      There is no way that I can see of using the UI to search and delete

      these characters.

       

      The unicode value of these markers is: 0x200E as it appears from the

      Info palette, but that Unicode value is shared by various things.

       

      Selecting a marker and get its contents (app.selection[0].contents)

      returns the number: 1399616109. This is in fact the number for

      SpecialCharacters.LEFT_TO_RIGHT_MARK.

       

      To cut a long story short and make a specific question general:

       

      How do you search for a SpecialCharacter that doesn't have an escape

      code in the GREP find/replace?

       

      What I've done so far is looped through all the characters in the

      document and compared their contents to 1399616109. But this is very

      slow, and is also causing InDesign to crash.

       

      Is there a better way?

       

      Thanks,

      Ariel

       

        • 1. Re: Search document for SpecialCharacters Enumerator
          Marc Autret Level 4

          Hi Ariel,

           

          Use the Unicode code point in the GREP F/R field this way:

          \x{200E}

           

          See also:

          http://www.indiscripts.com/post/2009/07/idcs4-special-characters

           

          @+

          Marc

          • 2. Re: Search document for SpecialCharacters Enumerator
            TᴀW Adobe Community Professional & MVP

            Hi Marc,

             

            Thank you. I couldn't find that documented anywhere.

             

            Ariel

            • 3. Re: Search document for SpecialCharacters Enumerator
              Marc Autret Level 4

              To complete my previous post:

               

              1) Given a Character myChar whose contents property returns a SpecialCharacter enumerator, you can still retrieve the Unicode codepoint using myChar.texts[0].contents instead of myChar.contents:

               

              alert( myChar.texts[0].contents.charCodeAt(0).toString(16) ); // => Unicode CP (hexa)
              

               

               

              2) Since ID CS5 the Enumeration objects (Locale, SpecialCharacters, etc.) describe a set of Enumerator objects rather than a set of numbers. An Enumerator is a special native object which converts itself into either a String or a Number depending on the context:

               

              // ID CS5+
              alert( SpecialCharacters.emDash ); // => EM_DASH (string)
              alert( +SpecialCharacters.emDash ); // => 1397058884 (number)
              

               

              In fact, these respectively correspond to myEnumerator.toString() and myEnumerator.valueOf():

               

              // ID CS5+
              
              var myEnumerator = SpecialCharacters.emDash;
              
              alert( myEnumerator.toString() ); // => EM_DASH (string)
              alert( myEnumerator.valueOf() ); // => 1397058884 (number)
              

               

              But every Enumerator has its == and === operators overriden so as we can still compare it with a number:

               

              alert( SpecialCharacters.emDash==1397058884 ); // => true
              alert( SpecialCharacters.emDash===1397058884 ); // => true
              

               

              Also, an Enumeration object see both the camelcase and the uppercase name of an enumerator as a regular own property:

               

              // ID CS5+
              alert( SpecialCharacters.hasOwnProperty('emDash') ); // => true
              alert( SpecialCharacters.hasOwnProperty('EM_DASH') ); // => true
              

               

              Both are [[enumerable]] but the for-in loop only collects the uppercase forms ('EM_DASH', etc.).

               

              @+

              Marc

              • 4. Re: Search document for SpecialCharacters Enumerator
                Trevorׅ Adobe Community Professional

                Hi Marc or anybody else who knows

                 

                Is there a way of getting the full Enumeration string, i.e. SpecialCharacters.EM_DASH and not just EM_DASH ?

                 

                Regards

                 

                Trevor

                • 5. Re: Search document for SpecialCharacters Enumerator
                  Harbs. Adobe Community Professional & MVP

                  Huh?

                  I'm not sure what you are asking...

                  • 6. Re: Search document for SpecialCharacters Enumerator
                    Trevorׅ Adobe Community Professional

                    Hi Harbs

                     

                    If I want to get the Enumeration value for an object I could use for example.

                    app.selection[0].appliedParagraphStyle .diacriticPosition*1

                    I would get back the value for example 1685090164

                    To get the string of the enumaration I can use

                    app.selection[0].appliedParagraphStyle .diacriticPosition.toString()

                    this will return OPENTYPE_POSITION (will also return this without the toString but the toString prevents it revering back to a numeric)

                     

                    If I were to enter app.selection[0].appliedParagraphStyle .diacriticPosition = 1685090164 that's going to work

                    but if I enter app.selection[0].appliedParagraphStyle .diacriticPosition = OPENTYPE_POSITION that's not going to work.

                    In this non-numeric form I need to enter app.selection[0].appliedParagraphStyle .diacriticPosition = DiacriticPositionOptions.OPENTYPE_POSITION

                    Is there a way of "Extracting" this term DiacriticPositionOptions ?

                     

                    I hope that's clear (have my doubts) if still not clear I have a script that I can post that should make it clear.

                     

                    Trevor

                    • 7. Re: Search document for SpecialCharacters Enumerator
                      Trevorׅ Adobe Community Professional

                      I think it might be useful to include this script.

                       

                      I preduces a "manual" of how to set the properties of a selected object (between 40 to 100 pages of properties).

                      The script is not finished but works quite nicely.

                       

                      Select an object / text / something and then run the script. Takes about 30 seconds to run.

                       

                      If I say so myself it's quite a nice not script

                       

                      Let me know if all clear.

                       

                       

                      #target "indesign"
                      #targetengine "main"
                      
                      myDoc = app.activeDocument;
                      
                      mySelection=app.selection[0]
                      
                      pl=""
                          myProperties=mySelection;
                          myPropertiesString="app.selection[0]";
                      //mo = new Object
                      //mo = {a:4, b:5, c:{q:5, w:8, ss:"foo", fred:{we:5,fh:65}}, d:10};
                      s=""
                      ss=0;
                      myObjConstructor=myProperties.constructor.name.toString();
                      n = (myObjConstructor[0]=="A" ||myObjConstructor[0]=="E" ||myObjConstructor[0]=="I" ||myObjConstructor[0]=="O" ||myObjConstructor[0]=="U") ?
                      "n ": " ";
                      s="* "+myPropertiesString+" is a"+n+myObjConstructor+" *\r\r";
                      elem(myProperties,myPropertiesString)
                      function elem(obj, subObj)
                      {
                      var oldSubObj = subObj;    
                      var p=0
                      var y=[]
                      var z = []
                      for (x in obj)
                      { ++p
                          y[p]=x
                      ss++;
                      try { (obj[x]!=null) ? z[p]=obj[x] : z[p]="nullnulllnull";} catch (notApplicable) {z[p]="null"}
                      try {zz= z[p].properties} catch (np) {zz=z[p].constructor.name; /*alert(z[p])*/};
                      zzz=z[p].constructor.name;
                      szp=(zzz=="Enumerator") ? z[p].toString() + " or ":"";
                      if (z[p]!=null) 
                          { if     (zz=="[object Object]" )
                          {
                              if( y[p] !="parent"&& y[p] !="parentStory" 
                              && y[p] !="startTextFrame"  && y[p] !="endTextFrame"
                              && y[p] !="nextTextFrame"  && y[p] !="previousTextFrame"
                              && y[p]!="nextStyle" && y[p]!="previousStyle"
                              && y[p]!="pageStart" && y[p]!="pageEnd" 
                              && y[p]!="index" && y[p]!="index")  
                          {
                              var sz=(subObj+"."+y[p].toString())
                              s+=subObj+" ."+y[p]+" = "+z[p]+"\t"+zz+"\t"+zzz+" *\r";
                      
                      
                           
                            eval("elem("+sz+",'"+sz+"');");
                              
                          }}
                        else   {s+=subObj+" ."+y[p]+" = "+szp+z[p]+"\t"+zz+"\t"+zzz+"\r";subObj = oldSubObj ;}
                      } else  {s+=subObj+" ."+y[p]+" = "+szp+z[p]+"\t"+zz+"\t"+zzz+"\r"; subObj = oldSubObj ;}
                        
                      subObj = oldSubObj ;
                      }  }
                      myContents=s;
                      
                      myDoc = app.documents.add();
                      app.activeDocument.layoutWindows[0].screenMode = ScreenModeOptions.PRESENTATION_PREVIEW;
                      oldUnits=app.scriptPreferences.measurementUnit;
                      app.scriptPreferences.measurementUnit=MeasurementUnits.MILLIMETERS;
                      myDoc.documentPreferences.properties =
                      {facingPages:0, intent:DocumentIntentOptions.PRINT_INTENT, pageHeight:210,
                         pageWidth:297, pageOrientation:PageOrientation.LANDSCAPE}
                      setUpStyles();
                      mastertextFrames = myDoc.masterSpreads.item("A-Master").textFrames.add
                      ({geometricBounds: [200,0,210,297], contents:SpecialCharacters.AUTO_PAGE_NUMBER}); 
                      mastertextFrames.parentStory.paragraphs[0].justification=Justification.CENTER_ALIGN
                      mastertextFrames.duplicate([297,200])
                       myTextFrame = app.activeWindow.activePage.textFrames.add({geometricBounds:[12, 12, 198, 285], strokeWeight:0, strokeColor:"None"});
                      myTextFrame.parentStory.appliedParagraphStyle=mps
                      myTextFrame.parentStory.contents=myContents
                      while (myTextFrame.overflows) {addPage(myTextFrame)}
                      
                      
                      
                      
                      function addPage(prevTextFrame)
                      {
                          myPage = myDoc.pages.add();
                          myTextFrame = myPage.textFrames.add({geometricBounds:[12, 12, 198, 285], strokeWeight:0, strokeColor:"None"});
                          myTextFrame.previousTextFrame = prevTextFrame;
                      }
                      
                      function setUpStyles()
                      {
                          mcs=myDoc.characterStyles.add({name:"Value", fillColor:"Black", appliedFont:"Minion Pro", fontStyle:"Bold"});
                          mcs2=myDoc.characterStyles.add({name:"Properties", fillColor:"Black", appliedFont:"Minion Pro", fontStyle:"Bold Cond"});
                          mcs3=myDoc.characterStyles.add({name:"Property", fillColor:"Black", appliedFont:"Minion Pro", fontStyle:"Bold Italic", horizontalScale:115});
                          mcs4=myDoc.characterStyles.add({name:"Object", pointSize:6, underline:1});
                          
                          
                          mps=myDoc.paragraphStyles.add({name:"main", pointSize:3.5, fillColor:"C=0 M=100 Y=0 K=0", appliedFont:"Minion Pro", fontStyle:"Medium", justification:Justification.LEFT_ALIGN,
                          paragraphDirection:ParagraphDirectionOptions.LEFT_TO_RIGHT_DIRECTION, digitsType:DigitsTypeOptions.ARABIC_DIGITS})
                      mps.nestedGrepStyles.add({appliedCharacterStyle:mcs4, grepExpression:".+?\\*$"});
                      mps.nestedGrepStyles.add({appliedCharacterStyle:mcs, grepExpression:"(?<=\=).+?\\t"});
                      mps.nestedGrepStyles.add({appliedCharacterStyle:mcs2, grepExpression:"^\\S+"});
                      mps.nestedGrepStyles.add({appliedCharacterStyle:mcs3, grepExpression:"(?<=\s).+? \="});
                          
                      }    
                      app.activeWindow.activePage = app.activeDocument.pages[0];
                      
                      • 8. Re: Search document for SpecialCharacters Enumerator
                        Harbs. Adobe Community Professional & MVP

                        You can use Enum.valueOf() to get the numeric value.

                        • 9. Re: Search document for SpecialCharacters Enumerator
                          Trevorׅ Adobe Community Professional

                          But I don't want the numeric value I want the full enumaration string i.e.

                          DiacriticPositionOptions.OPENTYPE_POSITION as apposed to just OPENTYPE_POSITION

                           

                          Did you run the script?

                          • 10. Re: Search document for SpecialCharacters Enumerator
                            Laubender Adobe Community Professional & MVP

                            Trevorׅ wrote:

                            But I don't want the numeric value I want the full enumaration string i.e.

                            DiacriticPositionOptions.OPENTYPE_POSITION as apposed to just OPENTYPE_POSITION

                             

                             

                            Hi Trevor,
                            I know that this thread is more than four years old, but today Marc Autret linked to it.


                            To answer your question—if it is not answered yet—I think, you should study Dirk Becker's enumToSource.jsx script:

                            enumToSource.jsx script for Adobe InDesign

                             

                            Best,
                            Uwe

                            • 11. Re: Search document for SpecialCharacters Enumerator
                              Trevorׅ Adobe Community Professional

                              Hi Uwe

                               

                              I did get the answer a few years back.

                              I wrote the below myself before seeing Dirks version (not nicked).

                              From what I remember my version has some plus points, I think that Dirk's breaks if the Enum was removed from InDesign and my one doesn't but I really don't remember well.

                               

                              Thanks either way

                               

                              Trevor

                               

                              // script to show most of the selection properties by Trevor
                              // Creative-Scripts.Com (Still not ready!) available (sometimes) for custom scripts $$$
                              // scripts {at} Creative-Scripts [dot] Com
                              $.level = 0; // set debug mode to allow try catch (not read only as stated in manual);
                              var e;
                              $.writeln(getEnum(app.wordRTFImportPreferences.resolveCharacterStyleClash));
                              
                              function getEnum(prop) {
                                  var p, n, c, i;
                                  getEnum.enums = getEnum.enums || {
                                      AcrobatCompatibility: true,
                                      AddPageOptions: true,
                                      AdornmentOverprint: true,
                                      AlignDistributeBounds: true,
                                      AlignOptions: true,
                                      AlignmentStyleOptions: true,
                                      AlternateGlyphForms: true,
                                      AlternatingFillsTypes: true,
                                      AnchorPoint: true,
                                      AnchorPosition: true,
                                      AnchoredRelativeTo: true,
                                      AnimationEaseOptions: true,
                                      AnimationPlayOperations: true,
                                      AntiAliasType: true,
                                      ArrangeBy: true,
                                      ArrowHead: true,
                                      AssetType: true,
                                      AssignmentExportOptions: true,
                                      AssignmentStatus: true,
                                      AutoEnum: true,
                                      AutoSizingReferenceEnum: true,
                                      AutoSizingTypeEnum: true,
                                      BalanceLinesStyle: true,
                                      BaselineFrameGridRelativeOption: true,
                                      BaselineGridRelativeOption: true,
                                      BehaviorEvents: true,
                                      BevelAndEmbossDirection: true,
                                      BevelAndEmbossStyle: true,
                                      BevelAndEmbossTechnique: true,
                                      BindingOptions: true,
                                      BitmapCompression: true,
                                      BlendMode: true,
                                      BlendingSpace: true,
                                      BookContentStatus: true,
                                      BookletTypeOptions: true,
                                      BoundingBoxLimits: true,
                                      BuildingBlockTypes: true,
                                      BulletCharacterType: true,
                                      BulletListExportOption: true,
                                      Capitalization: true,
                                      ChangeBackgroundColorChoices: true,
                                      ChangeCaseOptions: true,
                                      ChangeConditionsModes: true,
                                      ChangeMarkings: true,
                                      ChangeTextColorChoices: true,
                                      ChangeTypes: true,
                                      ChangebarLocations: true,
                                      ChangecaseMode: true,
                                      ChapterNumberSources: true,
                                      CharacterAlignment: true,
                                      CharacterCountLocation: true,
                                      CharacterDirectionOptions: true,
                                      ClippingPathType: true,
                                      ColorModel: true,
                                      ColorOutputModes: true,
                                      ColorRenderingDictionary: true,
                                      ColorSettingsPolicy: true,
                                      ColorSpace: true,
                                      ComposeUsing: true,
                                      CompressionQuality: true,
                                      ConditionIndicatorMethod: true,
                                      ConditionIndicatorMode: true,
                                      ConditionUnderlineIndicatorAppearance: true,
                                      ContainerType: true,
                                      ContentType: true,
                                      ContourOptionsTypes: true,
                                      ConvertPageBreaks: true,
                                      ConvertShapeOptions: true,
                                      ConvertTablesOptions: true,
                                      CoordinateSpaces: true,
                                      CopyrightStatus: true,
                                      CornerOptions: true,
                                      CreateProxy: true,
                                      CrossReferenceType: true,
                                      CursorTypes: true,
                                      CustomLayoutTypeEnum: true,
                                      DataFormat: true,
                                      DefaultRenderingIntent: true,
                                      DesignOptions: true,
                                      DiacriticPositionOptions: true,
                                      DigitsTypeOptions: true,
                                      DimensionsConstraints: true,
                                      DisplayOrderOptions: true,
                                      DisplaySettingOptions: true,
                                      DistributeOptions: true,
                                      DocumentIntentOptions: true,
                                      DocumentPrintUiOptions: true,
                                      DynamicDocumentsJPEGQualityOptions: true,
                                      DynamicDocumentsTextExportPolicy: true,
                                      DynamicMediaHandlingOptions: true,
                                      DynamicTriggerEvents: true,
                                      EPSColorSpace: true,
                                      EPSImageData: true,
                                      EditingState: true,
                                      EmptyFrameFittingOptions: true,
                                      EndCap: true,
                                      EndJoin: true,
                                      EpubCover: true,
                                      EpubVersion: true,
                                      EventPhases: true,
                                      ExportFormat: true,
                                      ExportLayerOptions: true,
                                      ExportOrder: true,
                                      ExportPresetFormat: true,
                                      ExportRangeOrAllPages: true,
                                      FeatherCornerType: true,
                                      FeatherMode: true,
                                      FeatureSetOptions: true,
                                      FindChangeTransliterateCharacterTypes: true,
                                      FirstBaseline: true,
                                      FitDimension: true,
                                      FitMethodSettings: true,
                                      FitOptions: true,
                                      Fitting: true,
                                      FlattenerLevel: true,
                                      Flip: true,
                                      FlipValues: true,
                                      FloatingWindowPosition: true,
                                      FloatingWindowSize: true,
                                      FollowShapeModeOptions: true,
                                      FontDownloading: true,
                                      FontEmbedding: true,
                                      FontStatus: true,
                                      FontTypes: true,
                                      FootnoteFirstBaseline: true,
                                      FootnoteMarkerPositioning: true,
                                      FootnoteNumberingStyle: true,
                                      FootnotePrefixSuffix: true,
                                      FootnoteRestarting: true,
                                      GIFOptionsPalette: true,
                                      GlobalClashResolutionStrategy: true,
                                      GlobalClashResolutionStrategyForMasterPage: true,
                                      GlowTechnique: true,
                                      GoToZoomOptions: true,
                                      GradientType: true,
                                      GridAlignment: true,
                                      GridViewSettings: true,
                                      GuideTypeOptions: true,
                                      HeaderFooterBreakTypes: true,
                                      HeaderTypes: true,
                                      HorizontalAlignment: true,
                                      HorizontalOrVertical: true,
                                      HyperlinkAppearanceHighlight: true,
                                      HyperlinkAppearanceStyle: true,
                                      HyperlinkAppearanceWidth: true,
                                      HyperlinkDestinationPageSetting: true,
                                      ICCProfiles: true,
                                      IconSizes: true,
                                      ImageAlignmentType: true,
                                      ImageConversion: true,
                                      ImageDataTypes: true,
                                      ImageExportOption: true,
                                      ImageFormat: true,
                                      ImagePageBreakType: true,
                                      ImageResolution: true,
                                      ImageSizeOption: true,
                                      ImportFormat: true,
                                      ImportPlatform: true,
                                      ImportedPageCropOptions: true,
                                      InCopyUIColors: true,
                                      IndexCapitalizationOptions: true,
                                      IndexFormat: true,
                                      InkTypes: true,
                                      InnerGlowSource: true,
                                      InteractiveElementsOptions: true,
                                      InteractivePDFInteractiveElementsOptions: true,
                                      JPEGOptionsFormat: true,
                                      JPEGOptionsQuality: true,
                                      JoinOptions: true,
                                      JpegColorSpaceEnum: true,
                                      Justification: true,
                                      KashidasOptions: true,
                                      KentenAlignment: true,
                                      KentenCharacter: true,
                                      KentenCharacterSet: true,
                                      KinsokuHangTypes: true,
                                      KinsokuSet: true,
                                      KinsokuType: true,
                                      LanguageAndRegion: true,
                                      LayoutRuleOptions: true,
                                      Leading: true,
                                      LeadingModel: true,
                                      LibraryPanelViews: true,
                                      LineAlignment: true,
                                      LineSpacingType: true,
                                      LinkStatus: true,
                                      ListAlignment: true,
                                      ListType: true,
                                      LiveDrawingOptions: true,
                                      Locale: true,
                                      LocationOptions: true,
                                      LockStateValues: true,
                                      MapType: true,
                                      MarkLineWeight: true,
                                      MarkTypes: true,
                                      MatrixContent: true,
                                      MeasurementUnits: true,
                                      MojikumiTableDefaults: true,
                                      MonoBitmapCompression: true,
                                      MoviePlayOperations: true,
                                      MoviePosterTypes: true,
                                      NestedStyleDelimiters: true,
                                      NoteBackgrounds: true,
                                      NoteColorChoices: true,
                                      NothingEnum: true,
                                      NumberedListExportOption: true,
                                      NumberedParagraphsOptions: true,
                                      NumberingStyle: true,
                                      OTFFigureStyle: true,
                                      ObjectTypes: true,
                                      OpenOptions: true,
                                      OpenTypeFeature: true,
                                      OutlineJoin: true,
                                      OverrideType: true,
                                      PDFColorSpace: true,
                                      PDFCompressionType: true,
                                      PDFCrop: true,
                                      PDFJPEGQualityOptions: true,
                                      PDFMarkWeight: true,
                                      PDFProfileSelector: true,
                                      PDFRasterCompressionOptions: true,
                                      PDFXStandards: true,
                                      PNGColorSpaceEnum: true,
                                      PNGExportRangeEnum: true,
                                      PNGQualityEnum: true,
                                      PPDValues: true,
                                      PageBindingOptions: true,
                                      PageColorOptions: true,
                                      PageLayoutOptions: true,
                                      PageNumberPosition: true,
                                      PageNumberStyle: true,
                                      PageNumberingOptions: true,
                                      PageOrientation: true,
                                      PagePositions: true,
                                      PageRange: true,
                                      PageReferenceType: true,
                                      PageSideOptions: true,
                                      PageTransitionDirectionOptions: true,
                                      PageTransitionDurationOptions: true,
                                      PageTransitionOverrideOptions: true,
                                      PageTransitionTypeOptions: true,
                                      PageViewOptions: true,
                                      PaginationOption: true,
                                      PanelLayoutResize: true,
                                      PanningTypes: true,
                                      PaperSize: true,
                                      PaperSizes: true,
                                      ParagraphDirectionOptions: true,
                                      ParagraphJustificationOptions: true,
                                      PathType: true,
                                      PathTypeAlignments: true,
                                      PdfMagnificationOptions: true,
                                      PerformanceMetricOptions: true,
                                      PlacedVectorProfilePolicy: true,
                                      PlayOperations: true,
                                      PointType: true,
                                      Position: true,
                                      PositionalForms: true,
                                      PostScriptLevels: true,
                                      PreflightLayerOptions: true,
                                      PreflightProfileOptions: true,
                                      PreflightRuleFlag: true,
                                      PreflightScopeOptions: true,
                                      PreviewPagesOptions: true,
                                      PreviewSizeOptions: true,
                                      PreviewTypes: true,
                                      PrintLayerOptions: true,
                                      PrintPageOrientation: true,
                                      Printer: true,
                                      PrinterPresetTypes: true,
                                      Profile: true,
                                      ProofingType: true,
                                      RangeSortOrder: true,
                                      RasterCompressionOptions: true,
                                      RasterResolutionOptions: true,
                                      RecordSelection: true,
                                      RecordsPerPage: true,
                                      RenderingIntent: true,
                                      RepaginateOption: true,
                                      ResizeConstraints: true,
                                      ResizeMethods: true,
                                      ResolveStyleClash: true,
                                      RestartPolicy: true,
                                      RotationDirection: true,
                                      RowTypes: true,
                                      RubyAlignments: true,
                                      RubyKentenPosition: true,
                                      RubyOverhang: true,
                                      RubyParentSpacing: true,
                                      RubyTypes: true,
                                      RuleDataType: true,
                                      RuleWidth: true,
                                      RulerOrigin: true,
                                      SWFBackgroundOptions: true,
                                      SWFCurveQualityValue: true,
                                      Sampling: true,
                                      SaveOptions: true,
                                      ScaleModes: true,
                                      Screeening: true,
                                      ScreenModeOptions: true,
                                      ScriptLanguage: true,
                                      SearchModes: true,
                                      SearchStrategies: true,
                                      SelectAll: true,
                                      SelectionOptions: true,
                                      Sequences: true,
                                      ShadowMode: true,
                                      SignatureSizeOptions: true,
                                      SingleWordJustification: true,
                                      SmartMatchOptions: true,
                                      SnapshotBlendingModes: true,
                                      SortAssets: true,
                                      SoundPosterTypes: true,
                                      SourceFieldType: true,
                                      SourceSpaces: true,
                                      SourceType: true,
                                      SpanColumnCountOptions: true,
                                      SpanColumnTypeOptions: true,
                                      SpecialCharacters: true,
                                      SpreadFlattenerLevel: true,
                                      StartParagraph: true,
                                      StateTypes: true,
                                      StaticAlignmentOptions: true,
                                      StoryDirectionOptions: true,
                                      StoryHorizontalOrVertical: true,
                                      StoryTypes: true,
                                      StrokeAlignment: true,
                                      StrokeCornerAdjustment: true,
                                      StrokeFillProxyOptions: true,
                                      StrokeFillTargetOptions: true,
                                      StrokeOrderTypes: true,
                                      StyleConflict: true,
                                      StyleSheetExportOption: true,
                                      SyncConflictResolution: true,
                                      TabStopAlignment: true,
                                      TableDirectionOptions: true,
                                      TableFormattingOptions: true,
                                      TagRaster: true,
                                      TagTextExportCharacterSet: true,
                                      TagTextForm: true,
                                      TagTransparency: true,
                                      TagType: true,
                                      TagVector: true,
                                      TaggedPDFStructureOrderOptions: true,
                                      TaskAlertType: true,
                                      TaskState: true,
                                      TextExportCharacterSet: true,
                                      TextFrameContents: true,
                                      TextImportCharacterSet: true,
                                      TextPathEffects: true,
                                      TextStrokeAlign: true,
                                      TextTypeAlignments: true,
                                      TextWrapModes: true,
                                      TextWrapSideOptions: true,
                                      ThumbsPerPage: true,
                                      TilingTypes: true,
                                      ToolTipOptions: true,
                                      ToolsPanelOptions: true,
                                      TrapEndTypes: true,
                                      TrapImagePlacementTypes: true,
                                      Trapping: true,
                                      UIColors: true,
                                      UITools: true,
                                      UndoModes: true,
                                      UpdateLinkOptions: true,
                                      UserInteractionLevels: true,
                                      VariableNumberingStyles: true,
                                      VariableScopes: true,
                                      VariableTypes: true,
                                      VersionCueSyncStatus: true,
                                      VersionState: true,
                                      VerticalAlignment: true,
                                      VerticalJustification: true,
                                      VerticallyRelativeTo: true,
                                      ViewDisplaySettings: true,
                                      ViewZoomStyle: true,
                                      WarichuAlignment: true,
                                      WatermarkHorizontalPositionEnum: true,
                                      WatermarkVerticalPositionEnum: true,
                                      WhenScalingOptions: true,
                                      XFLRasterizeFormatOptions: true,
                                      XMLElementLocation: true,
                                      XMLElementPosition: true,
                                      XMLExportUntaggedTablesFormat: true,
                                      XMLFileEncoding: true,
                                      XMLImportStyles: true,
                                      XMLTransformFile: true,
                                      ZoomOptions: true,
                                  };
                                  getEnum.nnums = getEnum.nnums || {};
                                  if (getEnum.nnums[+prop] !== undefined) return getEnum.nnums[+prop];
                              
                                  for (n in getEnum.enums) {
                                      try {
                                          if ((p = $.global[n]) && p.constructor.name === "Enumeration") {
                                              for (i in p) {
                                                  c = +p[i];
                                                  getEnum.nnums[c] = n + "." + i;
                                              }
                                          }
                                      } catch (e) {}
                                  }
                                  if (getEnum.nnums[+prop] !== undefined) return getEnum.nnums[+prop];
                                  return "Enumerator UNKNOWN";
                              }
                              
                              • 12. Re: Search document for SpecialCharacters Enumerator
                                Marc Autret Level 4

                                Hi Uwe and Trevor,

                                 

                                Thanks a lot!

                                 

                                Dirk's code sounds definitely brilliant to me, as it only relies on parsing the $.dictionary database (meaning that it properly reflects the current DOM in use), and most importantly it fixes Enumerator's prototype in a way that makes toSource() both effective and verbose, including when you invoke toSource() from a parent DOM object properties that may contain enumerators. Also, the code only instantiates NothingEnum in the global scope (in order to wake up the Enumerator constructor—a live object entity) so one can consider it very 'non-polluting' when included in a larger project or framework.

                                 

                                Anyway, I had fun in writing a (slightly) different implementation which (slightly) increases the verbosity. Numbers are now formatted in 0xHEXA form and the Adobe 4-char tag is shown too. Here it is:

                                 

                                // Repair toSource() for enumerations [alternative version]
                                // for InDesign CS5 and later
                                // -------------------------------------
                                // Based on Dirk Becker's 2014 original code at
                                // http://ixta.com/scripts/utilities/enumToSource.html
                                // -------------------------------------
                                // Output either the format
                                // 
                                //     <Enumeration>.<Enumerator> /* <Hexa> [<Tag>] */
                                //     if <Enumeration> is the unique parent for that value,
                                //     e.g: AnchorPosition.INLINE_POSITION /* 414F5069 [AOPi] */
                                //     
                                // or
                                // 
                                //     0x<Hexa> /* <Enumerator> [<Tag>] */
                                //     if Enumerator's value belongs to multiple parents,
                                //     e.g: 0x74787466 /* TEXT_FRAME [txtf] */
                                // -------------------------------------
                                // TIP: You can access the whole 'database' (cache)
                                //      browsing the following object
                                //      NothingEnum.NOTHING.__proto__.toSource.Q
                                // -------------------------------------
                                (function(P)
                                {
                                    P.toSource = function F(){ return F.Q[this] || "({})" };
                                
                                    (function(/*obj&*/Q,  n,i,a,s,x,t,k,v)
                                    {
                                        const DIC = $.dictionary;
                                        const CHR = String.fromCharCode;
                                
                                        const FMT = $.global.localize;
                                        const REGULAR_PATTERN = "%1.%2 /*\xA0%3\xA0[%4]\xA0*/";
                                        const SPECIAL_PATTERN = "0x%3 /*\xA0%2\xA0[%4]\xA0*/";
                                
                                        for( a=DIC.getClasses(), n=a.length, i=-1 ; ++i < n ; )
                                        {
                                            x = DIC.getClass(s=a[i]).toXML();
                                            if( 'true' != x.@enumeration ) continue;
                                            x = x.elements.property;
                                
                                            for each( t in x )
                                            {
                                                k = String(t.@name);
                                                v = Number(t..value);
                                                
                                                Q[k] = FMT(
                                                    Q.hasOwnProperty(k) ? SPECIAL_PATTERN : REGULAR_PATTERN,
                                                    // %1 :: Enumeration class name
                                                    s,
                                                    // %2 :: Enumerator key
                                                    k,
                                                    // %3 :: Hexa representation
                                                    v.toString(16).toUpperCase(),
                                                    // %4 :: Adobe 4-char tag
                                                    CHR(0xFF&(v>>>24),0xFF&(v>>>16),0xFF&(v>>>8),0xFF&(v>>>0))
                                                );
                                            }
                                        }
                                    })( P.toSource.Q={} );
                                
                                })(NothingEnum.NOTHING.__proto__);
                                
                                
                                // Sample test:
                                // ---
                                
                                alert( Locale.frenchLocale.toSource() );
                                // => Locale.FRENCH_LOCALE /* 4C434672 [LCFr] */
                                

                                 

                                 

                                @+

                                Marc

                                2 people found this helpful
                                • 13. Re: Search document for SpecialCharacters Enumerator
                                  Dirk Becker Level 4

                                  Trevor is probably referring to the previous version that touched every enum.

                                  http://www.ixta.com/scripts/utilities/pretty.html

                                   

                                  Regards,

                                  Dirk

                                  2 people found this helpful
                                  • 14. Re: Search document for SpecialCharacters Enumerator
                                    Trevorׅ Adobe Community Professional

                                    Hi all

                                     

                                    Yes, Dirk, spot on, I was referring to the previous version I didn't see your new post until you pointed that out.

                                     

                                    Very nice implementations both yours and Marc's, looks like a real improvement on both our older versions.

                                    I now understand why Marc complimented your version above mine.

                                     

                                    Thanks and well done!

                                     

                                    Trevor

                                    • 15. Re: Search document for SpecialCharacters Enumerator
                                      Dirk Becker Level 4

                                      Here a few notes about Marc's version:

                                       

                                      By using the closure, you probably introduce some memory leaks. The toString() method assigned from within the closure will keep it around forever. My site has another utility based on $.summary that can point out such leaks, at http://ixta.com/scripts/utilities/summaryDifference.html - the leaks should be a workspace object (the closure) plus the outer anonymous function.

                                       

                                      Ages ago I was warned to not use __proto__, it is not equivalent to my .prototype approach. The ExtendScript engine makes some assumptions about that object. Unfortunately I only found an old email from 2006 where I mentioned that info, but not the original quote from Michael Däumling.

                                       

                                      Dirk

                                      • 16. Re: Search document for SpecialCharacters Enumerator
                                        Marc Autret Level 4

                                        Hi Dirk,

                                         

                                        Taking into account your informed opinion, here is an upgrade of my code safe of (workspace) leaks and using the regular constructor.prototype path. According to your great $.summary.difference() utility, its cost is now:

                                         

                                        1 Dictionary

                                        12 Function

                                        1 Math

                                        1 Enumeration

                                        1 Enumerator

                                        3 Object

                                        1 Reflection

                                         

                                        New code:

                                         

                                        // Repair toSource() for enumerations [alternative version]
                                        // for InDesign CS5 and later -- v.2.0
                                        // -------------------------------------
                                        // Based on Dirk Becker's 2014 original code at
                                        // http://ixta.com/scripts/utilities/enumToSource.html
                                        // -------------------------------------
                                        // Output either the format
                                        // 
                                        //     <Enumeration>.<Enumerator> /* <Hexa> [<Tag>] */
                                        //     if <Enumeration> is the unique parent for that value,
                                        //     e.g: AnchorPosition.INLINE_POSITION /* 414F5069 [AOPi] */
                                        //     
                                        // or
                                        // 
                                        //     0x<Hexa> /* <Enumerator> [<Tag>] */
                                        //     if Enumerator's value belongs to multiple parents,
                                        //     e.g: 0x74787466 /* TEXT_FRAME [txtf] */
                                        // -------------------------------------
                                        // TIP: You can access the whole 'database' (cache)
                                        //      browsing the following object
                                        //      NothingEnum.NOTHING.__proto__.toSource.Q
                                        // -------------------------------------
                                        (function(/*obj&*/Q,  n,i,a,s,x,t,k,v)
                                        {
                                            const DIC = $.dictionary;
                                            const CHR = String.fromCharCode;
                                        
                                            const FMT = $.global.localize;
                                            const REGULAR_PATTERN = "%1.%2 /*\xA0%3\xA0[%4]\xA0*/";
                                            const SPECIAL_PATTERN = "0x%3 /*\xA0%2\xA0[%4]\xA0*/";
                                        
                                            for( a=DIC.getClasses(), n=a.length, i=-1 ; ++i < n ; )
                                            {
                                                x = DIC.getClass(s=a[i]).toXML();
                                                if( 'true' != x.@enumeration ) continue;
                                                x = x.elements.property;
                                        
                                                for each( t in x )
                                                {
                                                    k = String(t.@name);
                                                    v = Number(t..value);
                                                    
                                                    Q[k] = FMT(
                                                        Q.hasOwnProperty(k) ? SPECIAL_PATTERN : REGULAR_PATTERN,
                                                        // %1 :: Enumeration class name
                                                        s,
                                                        // %2 :: Enumerator key
                                                        k,
                                                        // %3 :: Hexa representation
                                                        v.toString(16).toUpperCase(),
                                                        // %4 :: Adobe 4-char tag
                                                        CHR(0xFF&(v>>>24),0xFF&(v>>>16),0xFF&(v>>>8),0xFF&(v>>>0))
                                                    );
                                                }
                                            }
                                        })( (NothingEnum.NOTHING.constructor.prototype.toSource=function F(){ return F.Q[this] || "({})" }).Q={} );
                                        

                                         

                                        Best,

                                        Marc

                                        • 17. Re: Search document for SpecialCharacters Enumerator
                                          Trevorׅ Adobe Community Professional

                                          Ok my turn now

                                           

                                          DISCLAIMERS

                                           

                                          I did not test for memory leakages.

                                          I did not really test for anything much at all

                                          No fancy features like returning hex values

                                           

                                          But for a simple answer to my question of how to get the "ColorModel" part of the "ColorModel.PROCESS" enum the below method should work even if multiple enums had the property "PROCESS" to them.

                                           

                                          function getEnum(_enum) {
                                              if (getEnum.dataBase) {
                                                  return getEnum.dataBase[_enum] || "Enumerator Unknown";
                                              }
                                              var dic, _Class, n, l, en;
                                              getEnum.dataBase = {};
                                              dic = $.dictionary.getClasses();
                                              for (_Class in dic) {
                                                  en = dic[_Class];
                                                  if (!$.global[en]) continue;
                                                  reflection = $.global[en].reflect.properties;
                                                  l = reflection.length - 1;
                                                  for (n = 0; n < l; n++) {
                                                      getEnum.dataBase[$.global[en][reflection[n]]] = en + '.' + reflection[n];
                                                  }
                                              }
                                              return getEnum.dataBase[_enum] || "Enumerator Unknown";
                                          }
                                          
                                          /*** USAGE ***/
                                          var doc, rect, m;
                                          doc = app.documents.add();
                                          rect = doc.rectangles.add({ fillColor: doc.colors.itemByName("Cyan") });
                                          m = [
                                              'Using getEnum method',
                                              getEnum(rect.fillColor.space),
                                              getEnum(rect.fillColor.model),
                                              'Not using getEnum method',
                                              rect.fillColor.space,
                                              rect.fillColor.model
                                          ].join('\n');
                                          
                                          alert(m);
                                          /********************************
                                              Alerts
                                              Using getEnum method
                                              JpegColorSpaceEnum.CMYK
                                              ColorModel.PROCESS
                                              Not using getEnum method
                                              CMYK
                                              PROCESS
                                          ********************************/
                                          
                                          • 18. Re: Search document for SpecialCharacters Enumerator
                                            MasterDomino Level 1

                                            Hello dear scripting pros,
                                            I am trying to get this to work, however, I always get an error in the line with $.dictionary.getClasses(): Type error: null is not an object. I tested all variations Dirk's, Marc's and Trevor's, always the same error.

                                             

                                            So, $.dictionary is null in my case. Also I don't see where the .getClasses() method is coming from, as it is not listed in the ID object model? Do I need to make some preparations for this to work, like augment a prototype or something along these lines?

                                             

                                            Thanks for your help.

                                             

                                            TR

                                             

                                            (CS6, OS X 10.8.5, German local version)

                                            • 19. Re: Search document for SpecialCharacters Enumerator
                                              Laubender Adobe Community Professional & MVP

                                              Hi TR,

                                              just tested with CS6 8.1.0 and CC 9.3.0 on OSX 10.6.8.

                                              ESTK 4.0.0.1 with ExtendScript 4.5.5.

                                               

                                              $.dictionary will return null with CS6.

                                              $.dictionary will return [object Dictionary] with CC.

                                               

                                              So this is only working with CC and above, I think.

                                               

                                              Regards,
                                              Uwe

                                              • 20. Re: Search document for SpecialCharacters Enumerator
                                                MasterDomino Level 1

                                                Hi Uwe,

                                                 

                                                ah, okay. Since Marc wrote "for InDesign CS5 and later" I just assumed it would work for CS6, but then again, I should not expect that everyone checks every snippet against every version. So maybe it does work in CS5 (can't test it) and then again in CC?

                                                Either way, thanks for the confirmation, that it does not work in CS6.

                                                 

                                                (Btw. if anyone knows a workaround for CS6 that would be great of course, but I imagine this can be quite tricky.

                                                 

                                                Thanks Uwe!

                                                 

                                                Regards,
                                                TR

                                                • 21. Re: Search document for SpecialCharacters Enumerator
                                                  Trevorׅ Adobe Community Professional

                                                  Hi TR

                                                   

                                                  As a work around you could try my method in #11 that is if your aiming for the full enumerator.

                                                   

                                                  Regards

                                                   

                                                  TRevor

                                                   

                                                  P.s. If I get a chance I'll try the $.dic method on CS5

                                                  • 22. Re: Search document for SpecialCharacters Enumerator
                                                    Laubender Adobe Community Professional & MVP

                                                    Hi Trevor and TR,

                                                    just tested $.dictionary with CS5 and CS5.5.

                                                     

                                                    To my surprise:

                                                    $.dictionary will return [object Dictionary] with CS5.5.

                                                    $.dictionary will return [object Dictionary] with CS5.

                                                     

                                                    So maybe it's a bug, that $.dictionary will return null with CS6 8.1.0 ?

                                                     

                                                    OSX 10.6.8

                                                     

                                                    Regards,
                                                    Uwe

                                                    • 23. Re: Search document for SpecialCharacters Enumerator
                                                      Trevorׅ Adobe Community Professional

                                                      Well, what do you know?

                                                      Windows version  8.1.0.420 (CS6) works

                                                      Mac version 8.1.0.419 doesn't work

                                                      • 24. Re: Search document for SpecialCharacters Enumerator
                                                        MasterDomino Level 1

                                                        Interesting find.

                                                         

                                                        Just a side question, to rule this out: This is not possibly related to my version (and yours possibly to, Uwe?) being a localized German version?

                                                        Apparently not, if Trevor has the same result. Hm, quite annoying, really. :/

                                                        • 25. Re: Search document for SpecialCharacters Enumerator
                                                          Trevorׅ Adobe Community Professional

                                                          P.s. no chance of Adobe fixing that one.

                                                          • 27. Re: Search document for SpecialCharacters Enumerator
                                                            Laubender Adobe Community Professional & MVP

                                                            Trevorׅ  wrote

                                                             

                                                            Well, what do you know?

                                                            Windows version  8.1.0.420 (CS6) works

                                                            Mac version 8.1.0.419 doesn't work

                                                            What the hell…

                                                            FWIW: I'm on a German CS6 8.1.0.419 Mac OSX version.
                                                            So with Windows it'll work? Arrgh!

                                                             

                                                            Thanks for testing, Trevor!


                                                            Regards,
                                                            Uwe

                                                            • 28. Re: Search document for SpecialCharacters Enumerator
                                                              Trevorׅ Adobe Community Professional

                                                              How abouts

                                                               

                                                              if (!$.dictionary) $.dictionaryCS6Mac = {
                                                                  classes: ['Assignment', 'Assignments', 'AssignedStory', 'AssignedStories', 'PrintEvent', 'PlaceGun', 'EventListener', 'EventListeners', 'Event', 'Events', 'IdleEvent', 'MutationEvent', 'IdleTask', 'IdleTasks', 'ScriptArg', 'Application', 'BackgroundTask', 'BackgroundTasks', 'Document', 'Documents', 'Window', 'Windows', 'LayoutWindow', 'LayoutWindows', 'StoryWindow', 'StoryWindows', 'DocumentEvent', 'ImportExportEvent', 'ContentPlacerObject', 'Book', 'Books', 'BookContent', 'BookContents', 'Ink', 'Inks', 'TrapPreset', 'TrapPresets', 'MixedInk', 'MixedInks', 'MixedInkGroup', 'MixedInkGroups', 'Gradient', 'Gradients', 'GradientStop', 'GradientStops', 'Swatch', 'Swatches', 'Color', 'Colors', 'Tint', 'Tints', 'OpacityGradientStop', 'OpacityGradientStops', 'DataMergeTextPlaceholder', 'DataMergeTextPlaceholders', 'DataMergeImagePlaceholder', 'DataMergeImagePlaceholders', 'DataMergeField', 'DataMergeFields', 'StoryTypes', 'StoryDirectionOptions', 'ImportFormat', 'NestedStyleDelimiters', 'RuleWidth', 'Justification', 'SingleWordJustification', 'StartParagraph', 'HorizontalOrVertical', 'TabStopAlignment', 'FirstBaseline', 'VerticalJustification', 'Leading', 'OTFFigureStyle', 'Capitalization', 'Position', 'TextFrameContents', 'SpecialCharacters', 'ChangecaseMode', 'BindingOptions', 'PageOrientation', 'RulerOrigin', 'MeasurementUnits', 'PageBindingOptions', 'BaselineGridRelativeOption', 'PageSideOptions', 'WhenScalingOptions', 'PageColorOptions', 'DocumentIntentOptions', 'LayoutRuleOptions', 'SnapshotBlendingModes', 'EPSColorSpace', 'PreviewTypes', 'FontEmbedding', 'ScaleModes', 'PrintLayerOptions', 'UITools', 'GlobalClashResolutionStrategyForMasterPage', 'ClippingPathType', 'UpdateLinkOptions', 'IconSizes', 'PanelLayoutResize', 'PageViewOptions', 'PDFColorSpace', 'AcrobatCompatibility', 'ICCProfiles', 'BitmapCompression', 'CompressionQuality', 'MonoBitmapCompression', 'PDFMarkWeight', 'Sampling', 'ExportPresetFormat', 'PDFCrop', 'PDFCompressionType', 'PDFProfileSelector', 'PDFXStandards', 'ExportLayerOptions', 'PdfMagnificationOptions', 'PageLayoutOptions', 'RasterResolutionOptions', 'PDFRasterCompressionOptions', 'PDFJPEGQualityOptions', 'InteractiveElementsOptions', 'InteractivePDFInteractiveElementsOptions', 'PageTransitionOverrideOptions', 'TaggedPDFStructureOrderOptions', 'ConvertShapeOptions', 'CoordinateSpaces', 'MatrixContent', 'BoundingBoxLimits', 'ResizeConstraints', 'ResizeMethods', 'EmptyFrameFittingOptions', 'CornerOptions', 'DimensionsConstraints', 'ContentType', 'EndCap', 'EndJoin', 'StrokeCornerAdjustment', 'ArrowHead', 'DisplaySettingOptions', 'FitOptions', 'StrokeAlignment', 'GuideTypeOptions', 'ContourOptionsTypes', 'TextWrapSideOptions', 'TextWrapModes', 'FontStatus', 'FontTypes', 'OpenTypeFeature', 'CharacterAlignment', 'AlternateGlyphForms', 'AdornmentOverprint', 'KentenCharacter', 'RubyKentenPosition', 'KentenCharacterSet', 'RubyTypes', 'RubyAlignments', 'RubyParentSpacing', 'RubyOverhang', 'WarichuAlignment', 'KinsokuType', 'KinsokuHangTypes', 'LeadingModel', 'KinsokuSet', 'MojikumiTableDefaults', 'GridAlignment', 'KentenAlignment', 'ComposeUsing', 'PageNumberStyle', 'PaginationOption', 'GradientType', 'JoinOptions', 'PathType', 'PointType', 'CreateProxy', 'ImportedPageCropOptions', 'StrokeFillProxyOptions', 'StrokeFillTargetOptions', 'RotationDirection', 'LocationOptions', 'UIColors', 'NothingEnum', 'AutoEnum', 'EventPhases', 'ExportFormat', 'PlacedVectorProfilePolicy', 'ColorSettingsPolicy', 'DefaultRenderingIntent', 'ProofingType', 'ChangeConditionsModes', 'SearchModes', 'ObjectTypes', 'FindChangeTransliterateCharacterTypes', 'LibraryPanelViews', 'SortAssets', 'LinkStatus', 'AssetType', 'ChangeTypes', 'TextPathEffects', 'TextTypeAlignments', 'PathTypeAlignments', 'FlipValues', 'XMLElementLocation', 'XMLElementPosition', 'XMLImportStyles', 'XMLFileEncoding', 'ImageConversion', 'GIFOptionsPalette', 'JPEGOptionsQuality', 'JPEGOptionsFormat', 'XMLExportUntaggedTablesFormat', 'XMLTransformFile', 'AnchorPosition', 'HorizontalAlignment', 'VerticalAlignment', 'AnchoredRelativeTo', 'BalanceLinesStyle', 'VerticallyRelativeTo', 'PositionalForms', 'TextStrokeAlign', 'OutlineJoin', 'BaselineFrameGridRelativeOption', 'FootnoteFirstBaseline', 'FootnoteRestarting', 'FootnotePrefixSuffix', 'FootnoteNumberingStyle', 'FootnoteMarkerPositioning', 'OverrideType', 'GlobalClashResolutionStrategy', 'StoryHorizontalOrVertical', 'AddPageOptions', 'VariableTypes', 'VariableScopes', 'VariableNumberingStyles', 'SearchStrategies', 'ChangeCaseOptions', 'AutoSizingTypeEnum', 'AutoSizingReferenceEnum', 'SpanColumnTypeOptions', 'SpanColumnCountOptions', 'LineAlignment', 'GridViewSettings', 'CharacterCountLocation', 'InCopyUIColors', 'CursorTypes', 'AntiAliasType', 'LineSpacingType', 'RepaginateOption', 'BookContentStatus', 'SmartMatchOptions', 'RowTypes', 'HeaderFooterBreakTypes', 'AlternatingFillsTypes', 'StrokeOrderTypes', 'DisplayOrderOptions', 'FlattenerLevel', 'BlendingSpace', 'BlendMode', 'ShadowMode', 'FeatherMode', 'FeatherCornerType', 'SpreadFlattenerLevel', 'GlowTechnique', 'InnerGlowSource', 'BevelAndEmbossStyle', 'BevelAndEmbossTechnique', 'BevelAndEmbossDirection', 'FollowShapeModeOptions', 'PageNumberPosition', 'NumberedParagraphsOptions', 'TextImportCharacterSet', 'ImportPlatform', 'ConvertPageBreaks', 'TagTextExportCharacterSet', 'TagTextForm', 'StyleConflict', 'TextExportCharacterSet', 'ConvertTablesOptions', 'TableFormattingOptions', 'AlignmentStyleOptions', 'ResolveStyleClash', 'ContainerType', 'CopyrightStatus', 'IndexCapitalizationOptions', 'IndexFormat', 'CrossReferenceType', 'PageReferenceType', 'HeaderTypes', 'TagTransparency', 'TagVector', 'TagRaster', 'HyperlinkAppearanceHighlight', 'HyperlinkAppearanceWidth', 'HyperlinkAppearanceStyle', 'HyperlinkDestinationPageSetting', 'BuildingBlockTypes', 'RangeSortOrder', 'PreflightRuleFlag', 'RuleDataType', 'PreflightScopeOptions', 'PreflightLayerOptions', 'PreflightProfileOptions', 'PNGExportRangeEnum', 'PNGQualityEnum', 'PNGColorSpaceEnum', 'StateTypes', 'FloatingWindowPosition', 'FloatingWindowSize', 'MoviePosterTypes', 'MoviePlayOperations', 'SoundPosterTypes', 'BehaviorEvents', 'GoToZoomOptions', 'PlayOperations', 'AnimationPlayOperations', 'ViewZoomStyle', 'VersionState', 'EditingState', 'VersionCueSyncStatus', 'SyncConflictResolution', 'LanguageAndRegion', 'UserInteractionLevels', 'Locale', 'ScriptLanguage', 'FeatureSetOptions', 'UndoModes', 'OpenOptions', 'TaskState', 'TaskAlertType', 'SaveOptions', 'ZoomOptions', 'ViewDisplaySettings', 'AnchorPoint', 'ColorModel', 'ColorSpace', 'ScreenModeOptions', 'WatermarkVerticalPositionEnum', 'WatermarkHorizontalPositionEnum', 'PageNumberingOptions', 'ToolTipOptions', 'SelectionOptions', 'SelectAll', 'PreviewSizeOptions', 'ToolsPanelOptions', 'LiveDrawingOptions', 'PreviewPagesOptions', 'StaticAlignmentOptions', 'RenderingIntent', 'MarkLineWeight', 'MarkTypes', 'ColorOutputModes', 'DataFormat', 'Flip', 'FontDownloading', 'PagePositions', 'PostScriptLevels', 'PrintPageOrientation', 'ImageDataTypes', 'Sequences', 'SourceSpaces', 'ThumbsPerPage', 'TilingTypes', 'Trapping', 'InkTypes', 'PrinterPresetTypes', 'ColorRenderingDictionary', 'PageRange', 'PaperSize', 'PPDValues', 'Profile', 'Screeening', 'PaperSizes', 'Printer', 'TrapImagePlacementTypes', 'TrapEndTypes', 'EPSImageData', 'BookletTypeOptions', 'SignatureSizeOptions', 'DocumentPrintUiOptions', 'NoteBackgrounds', 'NoteColorChoices', 'ChangeMarkings', 'ChangebarLocations', 'ChangeTextColorChoices', 'ChangeBackgroundColorChoices', 'LockStateValues', 'JpegColorSpaceEnum', 'ExportRangeOrAllPages', 'RecordSelection', 'ArrangeBy', 'RecordsPerPage', 'Fitting', 'SourceFieldType', 'ListType', 'BulletCharacterType', 'NumberingStyle', 'RestartPolicy', 'ListAlignment', 'ChapterNumberSources', 'CustomLayoutTypeEnum', 'AssignmentExportOptions', 'AssignmentStatus', 'PanningTypes', 'AlignDistributeBounds', 'AlignOptions', 'DistributeOptions', 'SourceType', 'TagType', 'ImageFormat', 'ImageSizeOption', 'ImageResolution', 'ImageAlignmentType', 'ImagePageBreakType', 'PerformanceMetricOptions', 'SWFBackgroundOptions', 'XFLRasterizeFormatOptions', 'AnimationEaseOptions', 'DynamicTriggerEvents', 'PageTransitionTypeOptions', 'PageTransitionDirectionOptions', 'RasterCompressionOptions', 'DynamicDocumentsJPEGQualityOptions', 'DynamicDocumentsTextExportPolicy', 'FitMethodSettings', 'FitDimension', 'PageTransitionDurationOptions', 'SWFCurveQualityValue', 'DynamicMediaHandlingOptions', 'DesignOptions', 'ConditionIndicatorMethod', 'ConditionUnderlineIndicatorAppearance', 'ConditionIndicatorMode', 'SmoothScrollingOptions', 'FolioOrientationOptions', 'FolioBindingDirectionOptions', 'DigpubVersion', 'AttachedDevices', 'DigpubArticleVersion', 'ExportOrder', 'EpubCover', 'BulletListExportOption', 'NumberedListExportOption', 'StyleSheetExportOption', 'EpubVersion', 'ImageExportOption', 'MapType', 'ParagraphDirectionOptions', 'ParagraphJustificationOptions', 'CharacterDirectionOptions', 'DigitsTypeOptions', 'KashidasOptions', 'DiacriticPositionOptions', 'TableDirectionOptions', 'Hyperlink', 'Hyperlinks', 'Bookmark', 'Bookmarks', 'HyperlinkPageItemSource', 'HyperlinkPageItemSources', 'HyperlinkTextSource', 'HyperlinkTextSources', 'HyperlinkTextDestination', 'HyperlinkTextDestinations', 'HyperlinkPageDestination', 'HyperlinkPageDestinations', 'HyperlinkExternalPageDestination', 'HyperlinkExternalPageDestinations', 'HyperlinkURLDestination', 'HyperlinkURLDestinations', 'CrossReferenceFormat', 'CrossReferenceFormats', 'CrossReferenceSource', 'CrossReferenceSources', 'BuildingBlock', 'BuildingBlocks', 'ParagraphDestination', 'ParagraphDestinations', 'Index', 'Indexes', 'IndexOptions', 'Topic', 'Topics', 'CrossReference', 'CrossReferences', 'PageReference', 'PageReferences', 'IndexSection', 'IndexSections', 'FormField', 'FormFields', 'Button', 'Buttons', 'State', 'States', 'MultiStateObject', 'MultiStateObjects', 'CheckBox', 'CheckBoxes', 'ComboBox', 'ComboBoxes', 'ListBox', 'ListBoxes', 'RadioButton', 'RadioButtons', 'TextBox', 'TextBoxes', 'SignatureField', 'SignatureFields', 'Movie', 'Movies', 'NavigationPoint', 'NavigationPoints', 'Sound', 'Sounds', 'Behavior', 'Behaviors', 'GotoFirstPageBehavior', 'GotoFirstPageBehaviors', 'GotoLastPageBehavior', 'GotoLastPageBehaviors', 'GotoNextPageBehavior', 'GotoNextPageBehaviors', 'GotoPreviousPageBehavior', 'GotoPreviousPageBehaviors', 'GotoNextViewBehavior', 'GotoNextViewBehaviors', 'GotoPreviousViewBehavior', 'GotoPreviousViewBehaviors', 'GotoURLBehavior', 'GotoURLBehaviors', 'MovieBehavior', 'MovieBehaviors', 'ShowHideFieldsBehavior', 'ShowHideFieldsBehaviors', 'AnimationBehavior', 'AnimationBehaviors', 'OpenFileBehavior', 'OpenFileBehaviors', 'GotoNextStateBehavior', 'GotoNextStateBehaviors', 'GotoPreviousStateBehavior', 'GotoPreviousStateBehaviors', 'GotoStateBehavior', 'GotoStateBehaviors', 'ViewZoomBehavior', 'ViewZoomBehaviors', 'SoundBehavior', 'SoundBehaviors', 'GotoAnchorBehavior', 'GotoAnchorBehaviors', 'GotoPageBehavior', 'GotoPageBehaviors', 'ClearFormBehavior', 'ClearFormBehaviors', 'PrintFormBehavior', 'PrintFormBehaviors', 'SubmitFormBehavior', 'SubmitFormBehaviors', 'TimingSetting', 'TimingList', 'TimingLists', 'TimingGroup', 'TimingGroups', 'TimingTarget', 'TimingTargets', 'Layer', 'Layers', 'Spread', 'Spreads', 'Page', 'Pages', 'MasterSpread', 'MasterSpreads', 'PDFAttribute', 'PageItem', 'PageItems', 'Oval', 'Ovals', 'Rectangle', 'Rectangles', 'GraphicLine', 'GraphicLines', 'Polygon', 'Polygons', 'Group', 'Groups', 'Image', 'Images', 'EPS', 'EPSs', 'PDF', 'PDFs', 'WMF', 'WMFs', 'PICT', 'PICTs', 'Graphic', 'Graphics', 'TransformationMatrix', 'TransformationMatrices', 'FrameFittingOption', 'Guide', 'Guides', 'TextWrapPreference', 'ContourOption', 'Section', 'Sections', 'Path', 'Paths', 'PathPoint', 'PathPoints', 'SplineItem', 'SplineItems', 'EPSText', 'EPSTexts', 'ImportedPage', 'ImportedPages', 'MediaItem', 'MediaItems', 'Snippet', 'Snippets', 'MotionPreset', 'MotionPresets', 'Article', 'Articles', 'ArticleMember', 'ArticleMembers', 'ArticleChild', 'ArticleChildren', 'HtmlItem', 'HtmlItems', 'Library', 'Libraries', 'Asset', 'Assets', 'Link', 'Links', 'LinkMetadata', 'ObjectStyle', 'ObjectStyles', 'StoryPreference', 'TextFramePreference', 'TextPreference', 'TextDefault', 'DocumentPreference', 'GridPreference', 'GuidePreference', 'MarginPreference', 'PasteboardPreference', 'ViewPreference', 'DocumentPreset', 'DocumentPresets', 'PrintPreference', 'PrintBookletOption', 'PrintBookletPrintPreference', 'EPSExportPreference', 'ToolBox', 'ImagePreference', 'ImageIOPreference', 'ClippingPathSettings', 'GraphicLayerOption', 'GraphicLayer', 'GraphicLayers', 'IMEPreference', 'PDFExportPreference', 'PDFExportPreset', 'PDFExportPresets', 'PDFPlacePreference', 'InteractivePDFExportPreference', 'TaggedPDFPreference', 'PageItemDefault', 'ObjectExportOption', 'TextEditingPreference', 'MojikumiUiPreference', 'FontLockingPreference', 'DictionaryPreference', 'PolygonPreference', 'SpellPreference', 'AutoCorrectPreference', 'SmartGuidePreference', 'EPSImportPreference', 'ImportedPageAttribute', 'StrokeFillProxySetting', 'LayoutAdjustmentPreference', 'Preference', 'Preferences', 'ScriptPreference', 'ColorSetting', 'FindChangeTextOption', 'FindChangeGrepOption', 'FindChangeGlyphOption', 'FindChangeObjectOption', 'FindChangeTransliterateOption', 'FindTextPreference', 'FindGrepPreference', 'FindGlyphPreference', 'FindObjectPreference', 'FindTransliteratePreference', 'ChangeTextPreference', 'ChangeGrepPreference', 'ChangeGlyphPreference', 'ChangeObjectPreference', 'ChangeTransliteratePreference', 'LinkingPreference', 'InCopyExportOption', 'PrinterPreset', 'PrinterPresets', 'XMLImportPreference', 'XMLExportPreference', 'XMLPreference', 'ExportForWebPreference', 'AnchoredObjectDefault', 'AnchoredObjectSetting', 'BaselineFrameGridOption', 'FootnoteOption', 'PageNumberVariablePreference', 'ChapterNumberVariablePreference', 'DateVariablePreference', 'FileNameVariablePreference', 'MatchCharacterStylePreference', 'MatchParagraphStylePreference', 'CustomTextVariablePreference', 'CaptionMetadataVariablePreference', 'GridDataInformation', 'LayoutGridDataInformation', 'StoryGridDataInformation', 'CjkGridPreference', 'GridPrintingPreference', 'GalleyPreference', 'FlattenerPreset', 'FlattenerPresets', 'FlattenerPreference', 'TransparencyPreference', 'TransparencySetting', 'StrokeTransparencySetting', 'FillTransparencySetting', 'BlendingSetting', 'DropShadowSetting', 'FeatherSetting', 'InnerShadowSetting', 'OuterGlowSetting', 'InnerGlowSetting', 'BevelAndEmbossSetting', 'SatinSetting', 'ContentTransparencySetting', 'DirectionalFeatherSetting', 'GradientFeatherSetting', 'FindChangeTransparencySetting', 'FindChangeStrokeTransparencySetting', 'FindChangeFillTransparencySetting', 'FindChangeContentTransparencySetting', 'FindChangeBlendingSetting', 'FindChangeDropShadowSetting', 'FindChangeFeatherSetting', 'FindChangeInnerShadowSetting', 'FindChangeOuterGlowSetting', 'FindChangeInnerGlowSetting', 'FindChangeBevelAndEmbossSetting', 'FindChangeSatinSetting', 'FindChangeDirectionalFeatherSetting', 'FindChangeGradientFeatherSetting', 'TextImportPreference', 'TextExportPreference', 'WordRTFImportPreference', 'TaggedTextExportPreference', 'TaggedTextImportPreference', 'ExcelImportPreference', 'MetadataPreference', 'DisplayPerformancePreference', 'DisplaySetting', 'DisplaySettings', 'XMLViewPreference', 'PreflightOption', 'PreflightBookOption', 'PNGExportPreference', 'ButtonPreference', 'WatermarkPreference', 'GeneralPreference', 'ClipboardPreference', 'TransformPreference', 'NotePreference', 'TrackChangesPreference', 'JPEGExportPreference', 'DataMergePreference', 'DataMergeOption', 'DataMerge', 'ChapterNumberPreference', 'ObjectStyleObjectEffectsCategorySettings', 'ObjectStyleStrokeEffectsCategorySettings', 'ObjectStyleFillEffectsCategorySettings', 'ObjectStyleContentEffectsCategorySettings', 'GrabberPreference', 'AlignDistributePreference', 'SWFExportPreference', 'XFLExportPreference', 'AnimationSetting', 'ConditionalTextPreference', 'EPubExportPreference', 'HTMLExportPreference', 'LinkedStoryOption', 'ParaStyleMapping', 'ParaStyleMappings', 'CellStyleMapping', 'CellStyleMappings', 'CharStyleMapping', 'CharStyleMappings', 'TableStyleMapping', 'TableStyleMappings', 'LinkedPageItemOption', 'PreflightRule', 'PreflightRules', 'RuleDataObject', 'RuleDataObjects', 'PreflightRuleInstance', 'PreflightRuleInstances', 'PreflightProfile', 'PreflightProfiles', 'PreflightProcess', 'PreflightProcesses', 'PreflightProfileRule', 'PreflightProfileRules', 'StrokeStyle', 'StrokeStyles', 'DashedStrokeStyle', 'DashedStrokeStyles', 'DottedStrokeStyle', 'DottedStrokeStyles', 'StripedStrokeStyle', 'StripedStrokeStyles', 'TOCStyle', 'TOCStyles', 'TOCStyleEntry', 'TOCStyleEntries', 'Cell', 'Cells', 'Table', 'Tables', 'Column', 'Columns', 'Row', 'Rows', 'TableStyle', 'TableStyles', 'TableStyleGroup', 'TableStyleGroups', 'CellStyle', 'CellStyles', 'CellStyleGroup', 'CellStyleGroups', 'NestedLineStyle', 'NestedLineStyles', 'NestedGrepStyle', 'NestedGrepStyles', 'Text', 'Texts', 'Character', 'Characters', 'Word', 'Words', 'Line', 'Lines', 'TextColumn', 'TextColumns', 'Paragraph', 'Paragraphs', 'TextStyleRange', 'TextStyleRanges', 'InsertionPoint', 'InsertionPoints', 'TextFrame', 'TextFrames', 'Story', 'Stories', 'ParagraphStyle', 'ParagraphStyles', 'CharacterStyle', 'CharacterStyles', 'TabStop', 'TabStops', 'NestedStyle', 'NestedStyles', 'Language', 'Languages', 'LanguageWithVendors', 'LanguagesWithVendors', 'Font', 'Fonts', 'KinsokuTable', 'KinsokuTables', 'MojikumiTable', 'MojikumiTables', 'HyphenationException', 'HyphenationExceptions', 'UserDictionary', 'UserDictionaries', 'AutoCorrectTable', 'AutoCorrectTables', 'Change', 'Changes', 'TextPath', 'TextPaths', 'Note', 'Notes', 'Footnote', 'Footnotes', 'TextVariable', 'TextVariables', 'TextVariableInstance', 'TextVariableInstances', 'StyleExportTagMap', 'StyleExportTagMaps', 'ParagraphStyleGroup', 'ParagraphStyleGroups', 'CharacterStyleGroup', 'CharacterStyleGroups', 'CompositeFont', 'CompositeFonts', 'CompositeFontEntry', 'CompositeFontEntries', 'NamedGrid', 'NamedGrids', 'IndexingSortOption', 'IndexingSortOptions', 'Bullet', 'NumberingRestartPolicy', 'NumberingList', 'NumberingLists', 'ObjectStyleGroup', 'ObjectStyleGroups', 'Condition', 'Conditions', 'HiddenText', 'HiddenTexts', 'ConditionSet', 'ConditionSets', 'PagesPanel', 'LibraryPanel', 'MenuAction', 'MenuActions', 'ScriptMenuAction', 'ScriptMenuActions', 'Menu', 'Menus', 'MenuElement', 'MenuElements', 'Submenu', 'Submenus', 'MenuItem', 'MenuItems', 'MenuSeparator', 'MenuSeparators', 'Panel', 'Panels', 'Dialog', 'Dialogs', 'Widget', 'Widgets', 'TextEditbox', 'TextEditboxes', 'StaticText', 'StaticTexts', 'Dropdown', 'Dropdowns', 'CheckboxControl', 'CheckboxControls', 'DialogColumn', 'DialogColumns', 'RadiobuttonGroup', 'RadiobuttonGroups', 'RadiobuttonControl', 'RadiobuttonControls', 'IntegerEditbox', 'IntegerEditboxes', 'IntegerCombobox', 'IntegerComboboxes', 'EnablingGroup', 'EnablingGroups', 'AngleCombobox', 'AngleComboboxes', 'PercentCombobox', 'PercentComboboxes', 'RealEditbox', 'RealEditboxes', 'PercentEditbox', 'PercentEditboxes', 'AngleEditbox', 'AngleEditboxes', 'RealCombobox', 'RealComboboxes', 'MeasurementCombobox', 'MeasurementComboboxes', 'MeasurementEditbox', 'MeasurementEditboxes', 'BorderPanel', 'BorderPanels', 'DialogRow', 'DialogRows', 'XMLElement', 'XMLElements', 'XMLAttribute', 'XMLAttributes', 'XMLTag', 'XMLTags', 'XMLImportMap', 'XMLImportMaps', 'XMLExportMap', 'XMLExportMaps', 'ValidationError', 'ValidationErrors', 'XMLComment', 'XMLComments', 'XMLInstruction', 'XMLInstructions', 'XMLItem', 'XMLItems', 'DTD', 'DTDs', 'XmlStory', 'XmlStories', 'XMLRuleProcessor', 'XMLRuleProcessors', 'XMLRuleMatchDat'],
                                                                  getClasses: function() {
                                                                      return this.classes;
                                                                  }
                                                              };
                                                              
                                                              try {$.dictionary.getClasses();} catch (e) {$.dictionaryCS6Mac.getClasses();}
                                                              
                                                              • 29. Re: Search document for SpecialCharacters Enumerator
                                                                Dirk Becker Level 4

                                                                That $.dictionary is very similar to the OMV files, so it might help to point the ESTK's object model viewer to your application (i.e. InDesign) and thus cause a rebuild of the OMV file. Eventually even the current script version (as in "versioned script") is considered.

                                                                 

                                                                Regards,

                                                                Dirk

                                                                • 30. Re: Search document for SpecialCharacters Enumerator
                                                                  Trevorׅ Adobe Community Professional

                                                                  Hi Dirk

                                                                   

                                                                  Didn't help for me.

                                                                  One could of course loads the omv from the disk to create the sort of fake $.dictionary I posted in 28

                                                                   

                                                                  Regards

                                                                   

                                                                  Trevor

                                                                  • 31. Re: Search document for SpecialCharacters Enumerator
                                                                    Marc Autret Level 4

                                                                    So, to summarize, $.dictionary may return null in a very few CS6 builds.

                                                                     

                                                                    At this point my personal workaround will be to just prepend `$.dictionary &&` before the whole snippet, so that Enumerator.toSource() will work the native way in that special case.

                                                                     

                                                                    @+

                                                                    Marc

                                                                    • 32. Re: Search document for SpecialCharacters Enumerator
                                                                      Marc Autret Level 4

                                                                      So here is my current implementation of the whole thing. (Note that Enumeration.toSource() has been added too. I needed it for improving my ExtendScript-oriented JSON module.)

                                                                       

                                                                      //==========================================================================
                                                                      // Number.prototype.toHexa() ; Number.prototype.toAdbe()
                                                                      //==========================================================================
                                                                      
                                                                      Number.prototype.toHexa = function toHexa()
                                                                      //----------------------------------
                                                                      // Return the "0xHHHH" representation of this number.
                                                                      // E.g  123456 => "0x1E240"
                                                                      {
                                                                          return isNaN(this) ?
                                                                              'NaN' :
                                                                              ( '0x' + this.toString(16).toUpperCase() );
                                                                      };
                                                                      
                                                                      Number.prototype.toAdbe = function toAdbe()
                                                                      //----------------------------------
                                                                      // Return the Adobe's 4-char string this number encodes.
                                                                      // [REM] Only makes sense if `this` is U32.
                                                                      // E.g  0x414F5069 => "AOPi" ; 0x74787466 => "txtf"
                                                                      {
                                                                          return isNaN(this) ?
                                                                              'NaN' :
                                                                              String.fromCharCode( 0xFF&(this>>>24), 0xFF&(this>>>16), 0xFF&(this>>>8), 0xFF&(this>>>0) );
                                                                      };
                                                                      
                                                                      
                                                                      //==========================================================================
                                                                      // Temporary global aliases.
                                                                      //==========================================================================
                                                                      
                                                                      $.global.E9nProto = NothingEnum.constructor.prototype;
                                                                      $.global.E8rProto = ('object' == typeof NothingEnum.NOTHING) && NothingEnum.NOTHING.constructor.prototype;
                                                                      
                                                                      
                                                                      //==========================================================================
                                                                      // IMPLEMENTATION NOTES
                                                                      //==========================================================================
                                                                      
                                                                      /*
                                                                      Idea based on Dirk Becker's 2014 original code at ixta.com.
                                                                      
                                                                      Looping through $.dictionary.getClasses() allows to collect every class
                                                                      whose Reflection has the 'enumeration' flag. From then we can both
                                                                      
                                                                      (a) Build a hashkey from the XML representation of the class (based on
                                                                          the sequence of its enum keys) so that we feed a {hash=>className}
                                                                          mapping. This process is achieved using an xpath() command.
                                                                          
                                                                      =>  Allows to implement Enumeration.prototype.toSource().
                                                                      
                                                                      (b) Register each enum key in a {key=>data} structure so that data is
                                                                          either a number (if no unique Enumeration is attached to that value),
                                                                          or a <value>/<className> string otherwise.
                                                                      
                                                                      =>  Allows to implement Enumerator.prototype.toSource() in CS5 and later.
                                                                      
                                                                      All needed data are cached in the corresponding methods: callee.DB for
                                                                      both, and callee.ENUM_XPATH for Enumeration's xpath request.
                                                                      
                                                                      Note. - The below code may consume more than 200 ms in CC 2017 (Win64.)
                                                                      
                                                                      [FIX170322]. - It seems that $.dictionary may return `null` in rare CS6
                                                                      versions. In that case we just ignore the whole fixer.
                                                                      */
                                                                      
                                                                      $.dictionary && (function(/*fct*/fClasses,/*fct|false*/fKeys,  QC,XP,QK,a,n,i,x,s,t,k,v)
                                                                      {
                                                                          const DIC = $.dictionary;
                                                                      
                                                                          QC = (fClasses.DB = {/*hashProps => className*/});
                                                                          XP = (fClasses.ENUM_XPATH = "//property[datatype/type='number' or datatype/type='Enumerator']/@name");
                                                                          QK = fKeys ? (fKeys.DB = {/*key => value[/className]*/}) : 0;
                                                                      
                                                                          for( a=DIC.getClasses(), n=a.length, i=-1 ; ++i < n ; )
                                                                          {
                                                                              x = DIC.getClass(s=a[i]).toXML();
                                                                      
                                                                              if( 'true' != x.@enumeration ) continue;
                                                                      
                                                                              // Enum Classes
                                                                              // ---
                                                                              QC[String(x.xpath(XP))] = s;
                                                                      
                                                                              if( !QK ) continue; // before CS5
                                                                      
                                                                              // Enum Keys
                                                                              // [FIX170319] Check whether x..property has more than one
                                                                              // item (.length()>1) otherwise `for each` would loop inside!
                                                                              // ---
                                                                              x = ( 1 < (t=x..property).length() ) ? t : (t.parent());
                                                                      
                                                                              if( null===x ){ throw Error("XML Error on Enumeration " + s); }
                                                                      
                                                                              for each( t in x )
                                                                              {
                                                                                  k = String(t.@name);
                                                                                  v = Number(t..value);
                                                                                  if( !(k&&v) ){ throw Error("XML Error on Enumeration " + s); }
                                                                                  QK[k] = QK.hasOwnProperty(k) ? v : (v + '/' + s);
                                                                              }
                                                                          }
                                                                      })
                                                                      (
                                                                          (E9nProto.toSource = function toSource(/*0|1=0*/VERBOSE)
                                                                          //----------------------------------
                                                                          // Output an evaluable string S such as this==eval(S) for any Enumeration.
                                                                          // Eg. Locale.toSource() => "(Locale)"
                                                                          {
                                                                              return '(' +
                                                                                  (
                                                                                      callee.DB[String(this.reflect.toXML().xpath(callee.ENUM_XPATH))] ||
                                                                                      ( "{" + (VERBOSE?"/*not found Enumeration*/":"") + "}" )
                                                                                  ) +
                                                                                  ')';
                                                                          }),
                                                                          
                                                                          E8rProto && (E8rProto.toSource = function toSource(/*0|1=0*/VERBOSE,  k,v,s)
                                                                          //----------------------------------
                                                                          // Output an evaluable string S such as this==eval(S) for any Enumerator.
                                                                          // =>
                                                                          //   <Enumeration>.<Enumerator> /* 0x<Hexa> [<Tag>] */
                                                                          //   if <Enumeration> is the unique parent for that value,
                                                                          //   Eg: AnchorPosition.INLINE_POSITION /* 0x414F5069 [AOPi] */
                                                                          //
                                                                          // or
                                                                          //
                                                                          //   0x<Hexa> /* <Enumerator> [<Tag>] */
                                                                          //   if Enumerator's value belongs to multiple parents,
                                                                          //   e.g: 0x74787466 /* TEXT_FRAME [txtf] */
                                                                          //
                                                                          // [REM] The comment part /*...*/ is added only if VERBOSE is on.
                                                                          {
                                                                              if( (v=callee.DB[k=String(this)]) && 'string' == typeof v )
                                                                              {
                                                                                  // Case 1  --  String("<number>/<class>")
                                                                                  // => EnumClass.ENUM_KEY format.
                                                                                  // ---
                                                                                  s = v.substr(1+v.indexOf('/')) + '.' + k;
                                                                                  if( !VERBOSE ) return s;
                                                                      
                                                                                  v = parseInt(v,10);
                                                                                  k = v.toHexa();
                                                                              }
                                                                              else
                                                                              {
                                                                                  // Case 2 -- Unknown key or number only (multiple parents.)
                                                                                  // => 0xHHHH format.
                                                                                  // ---
                                                                                  s = (v||(v=this.valueOf())).toHexa();
                                                                                  if( !VERBOSE ) return s;
                                                                              }
                                                                      
                                                                              return $.global.localize("%1 /* %2 [%3] */", s, k, v.toAdbe());
                                                                          })
                                                                      );
                                                                      
                                                                      
                                                                      //==========================================================================
                                                                      // Clear globals.
                                                                      //==========================================================================
                                                                      
                                                                      delete $.global.E9nProto;
                                                                      delete $.global.E8rProto;
                                                                      delete $.global.NothingEnum;
                                                                      
                                                                      
                                                                      //==========================================================================
                                                                      // Tests
                                                                      //==========================================================================
                                                                      
                                                                      alert( Locale.toSource() );
                                                                      // =>  "(Locale)"     --if( $.dictionary )
                                                                      // =>  "({})"         --fallback
                                                                      
                                                                      alert( Locale.germanLocale.toSource() );
                                                                      // => "Locale.GERMAN_LOCALE"      --if( CS5+ && $.dictionary)
                                                                      // => "(new Number(1279477613))"  --fallback
                                                                      
                                                                      alert( CoordinateSpaces.parentCoordinates.toSource(1) );
                                                                      // => "CoordinateSpaces.PARENT_COORDINATES /* 0x78797061 [xypa] */"   --if( CS5+ && $.dictionary)
                                                                      // => "(new Number(2021224545))"                                      --fallback
                                                                      

                                                                       

                                                                      @+

                                                                      Marc

                                                                      • 33. Re: Search document for SpecialCharacters Enumerator
                                                                        Trevorׅ Adobe Community Professional

                                                                        Sorry for being the days party pooper, but it ain't working for me.

                                                                        I get 3 alerts of ({})

                                                                        • 34. Re: Search document for SpecialCharacters Enumerator
                                                                          Marc Autret Level 4

                                                                          :-(

                                                                          In all versions and platforms? (Weird!)

                                                                           

                                                                          [I've tested it in six different versions from CS4 to CC (2017), of course outside of ESTK.]

                                                                           

                                                                          @+

                                                                          Marc

                                                                          • 35. Re: Search document for SpecialCharacters Enumerator
                                                                            Laubender Adobe Community Professional & MVP

                                                                            Hi Marc,

                                                                             

                                                                            tested your code from reply 32 :

                                                                             

                                                                            German CS4 6.0.6.622 on German Mac OSX 10.6.8 :
                                                                            Result: "(Locale)" , "(new Number(1279477613))" , "(new Number(2021224545))"

                                                                             

                                                                            German CS5 7.0.4.553 on German Mac OSX 10.6.8 :

                                                                            Result: "(Locale)" , "Locale.GERMAN_LOCALE" , "CoordinateSpaces.PARENT_COORDINATES /* 0x78797061 [xypa] */"

                                                                             

                                                                            German CS5.5 7.5.3.333 on German Mac OSX 10.6.8 :

                                                                            Result: "(Locale)" , "Locale.GERMAN_LOCALE" , "CoordinateSpaces.PARENT_COORDINATES /* 0x78797061 [xypa] */"

                                                                             

                                                                            German CS6 8.1.0.419 on German Mac OSX 10.6.8 :

                                                                            Result: ({}) , ({}) , ({})

                                                                             

                                                                            German CC 9.3.0.106 on German Mac OSX 10.6.8 :

                                                                            Result: "(Locale)" , "Locale.GERMAN_LOCALE" , "CoordinateSpaces.PARENT_COORDINATES /* 0x78797061 [xypa] */"

                                                                             

                                                                            Best,
                                                                            Uwe

                                                                            • 36. Re: Search document for SpecialCharacters Enumerator
                                                                              Marc Autret Level 4

                                                                              Hi Uwe,

                                                                               

                                                                              Thanks a lot for your detailed report.

                                                                               

                                                                              Almost what I was expecting. I just made a mistake in the description of the tests. Indeed, since the snippet does nothing if (!$.dictionary), toSource will simply behaves its native way in that specific case, which explains the ({}) results. One could likely improve this using either Trevor's approach—that is, hardcoding a fake $.dictionary—, or at least this.valueOf() for the purpose of returning a `Number(…)` source for Enumerators in CS6 8.1.0.419 Mac OSX 10.6.8.

                                                                               

                                                                              Left as an exercise to the readers ;-)

                                                                               

                                                                              @+,

                                                                              Marc