Skip to main content
Inspiring
February 17, 2017
Question

Accessing controls within a panel through scripting

  • February 17, 2017
  • 1 reply
  • 360 views

Hello,

I'm using a script to open the Media panel in InDesign CC 2015, but once it opens, I have no idea how to access the panel controls programmatically.

app.menuActions.itemByID(84228).invoke();

The Media panel contains a checkbox and a dropdown box.  Is it possible to access these controls via scripting once the panel is opened?

Thanks

This topic has been closed for replies.

1 reply

Community Expert
February 17, 2017

What do you want to do exactly?

If you want to get access to e.g. a placed movie's properties look up the object's properties and methods:

Adobe InDesign CS6 (8.0) Object Model JS: Movie

Regards,
Uwe

NelwayAuthor
Inspiring
February 17, 2017

Uwe,

Thanks for your reply.  I was trying to find an alternative way to setting the poster image on SWF files.  I have not been able to do this with the movie object properties.  Using the movie property moviePosterType = MoviePosterTypes['FROM_MOVIE'] works great with MP4 files, but throws an error if the movie is a SWF.

Error Number 81926: The poster image could not be changed to the requested image.

However, if I use the Media panel to manually select this option (labeled "From Current Frame") from the dropdown, then the moviePosterType is applied correctly.

Thanks

Community Expert
February 18, 2017

Hi Nelway,

I tried something with a menuAction.

At least there is a string for this available: "$ID/$$$/PosterOption/Frame"

But a menu action with that name is not valid, if the media panel is showing up and a movie frame is selected.
Maybe I did not place the right kind of swf ? You could have success with it and using invoke() on the menuAction if it is valid.

app.menuActions.itemByName("$ID/$$$/PosterOption/Frame").isValid;

// returns false with me

Two ideas:

1. Assign a new posterFile directly to the movie with movie.posterFile = "fullPathOfAnImageString".

2. Relink the StandardSwfPoster.jpg showing in the Links panel to a poster file image.

The problem would be providing a new poster file from the movie.

Regards,
Uwe