Skip navigation
Nav_alm
Currently Being Moderated

How to access the MSO slideshow controls in Indesign JavaScript

Aug 31, 2012 5:40 AM

Tags: #javascript #indesign #in #slideshow #to #how #access #the #controls #mso

Hi friends,

 

How can access the slideshow controls.

 

function mso_html_convertion_slide_show() {

 

        var mso_total_count = MSO.states.length;

 

          for (var i = 0; i < mso_total_count; i++) {

 

             MSO.states[i].name;

       }

 

}

 

slide_show.png

 

Thank you.

 

[ Nav ]

 
Replies
  • Currently Being Moderated
    Aug 31, 2012 8:05 AM   in reply to Nav_alm

    @Nav_alm – you'll do that by the JavaScript (ExtendScript) method

     

    .insertLabel("KeyString","ValueString");


    Keys and values can vary regarding DPS  and/or InDesign version.

     

    To examine a specific object (in your case a MSO) for keys and values already set, export the MSO to IDMS and check for the <Label> … </Label> tags.

     

    Or you can extract a value, if you already know the key ;-)

     

    An example for DPS v21 / InDesign CS5.5 for setting or extracting a value:

     

    myMSO.insertLabel("AutoStartDelay","5");
    

     

     

    var myValueString = myMSO.extractLable("AutoStartDelay");
    //Result for the example above would be the String object "5"
    

     

    The SlideShow Panel will read out that label of the MSO and reflect that in the UI after a refresh (close the panel, open the panel).

     

    Note: if you extract a value like that in the example above, you always get a String object. Even if it's looking like a number.

     

    That's just the basic thing. But in detail it's a bit more complex, because the Overlay Panel software will assume some defaults that are not set and show these, even if you did not set them explicitly.

     

    For example:

    when DPS is installed and you open a document with an MSOs, instantly every MSO is becoming a slide show and  a appropriate key/value pair is attached.

     

    You  can add key/value pairs or change values of keys, but you cannot remove key/value pairs other than exporting to IDMS or IDML, delete the labels in the XML and place the snippet (IDMS) or open the IDML as a new fresh document.

     

    Key/value pairs can grow in numbers, if new versions of DPS are issued (every 6 to 8 weeks) and new features will be introduced. Or they can change, if you compare DPS for InDesign CS5.5 with DPS for InDesign CS6.

    Therefore scripts written for one version could fail or result in unwanted results in future versions ("future" could be a very short time frame from 6 to 8 weeks).

     

    Uwe

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points