• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Accessing controls within a panel through scripting

Explorer ,
Feb 17, 2017 Feb 17, 2017

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

283

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 17, 2017 Feb 17, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 17, 2017 Feb 17, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 18, 2017 Feb 18, 2017

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 19, 2017 Feb 19, 2017

Copy link to clipboard

Copied

LATEST

Uwe,

Thanks for your suggestions.  I tried the string on different swf files, but unfortunately, the results were also invalid.  The only way to have the string return true was to change it to "$ID/$$$/PosterOption/None".  I only did this for testing purposes.  Although the string now returned true, the movie poster did not change from STANDARD to NONE upon invoking the menu action,

app.menuActions.itemByName("$ID/$$$/PosterOption/None").invoke();

I think I'm going to have to go with your idea #1.  Although it will take a little longer to create poster images separately and assign file paths to them as you suggested, in the long run it may be faster than having to manually select the "Current Frame" option from the Media panel dropdown on every swf file.

Thanks again for all your help!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines