Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Help with targeting contentType with javascript

$
0
0

Newbie with a problem with probably a obvious answer. I am having a little trouble in the script snippet below. In the for statement, the alert returns the contentType, so I know that I have an object selected and I can access the contentType enumeration. The switch statement (the real code where I want to process the selection depending on the contentType) returns nothing. This probably has a simple answer, I just don’t know it.

    for(var theCounter = 0; theCounter < app.selection.length ; theCounter++){

          var theThing = app.selection[theCounter].contentType;

          alert (theThing);

        

         switch(theThing){

          case 'GRAPHIC_TYPE' :

          alert("This is a graphic.");

          break;

         case 'TEXT_TYPE':

          alert("This is text");

          break;

       }  //End switch item checking

 

TIA


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>