Skip to main content
Participant
October 27, 2024
Answered

How do I access Plugin parameters via scripting?

  • October 27, 2024
  • 1 reply
  • 1057 views

I have a script that accesses a plugin I use, and I'm able to change the parameters successfully except for the nested ones. Is there a standard format or character to use to access these, because I can't figure it out?!

Can provide more code if necessary, but essentially, I'm able to access the non-nested (e.g., `Random seed`)by using the correct title case as below, but not sure about the nested ones (e.g., Composite noise: Intensity):

var paramMapping = {
        "random_seed": ["Random seed"],
        "use_field": ["Use field"],
        "filter_type": ["Lowpass filter type"],
        "input_luma_filter": ["Input luma filter"],
        "chroma_lowpass_in": ["Chroma low-pass in"],
        "composite_preemphasis": ["Composite preemphasis"],
        "composite_noise": ["Composite noise", "Composite noise"],
        "composite_noise_intensity": ["Composite noise", "Intensity"],
        "composite_noise_frequency": ["Composite noise", "Frequency"],

Any help or thoughts is appreciated, thanks.

This topic has been closed for replies.
Correct answer Dan Ebberts

Oh that's very helpful. Do you mind if I ask how you discovered that? Then I can fill in the rest of the parameters. Is it in the source code somwhere?


If you write scripts that might be used on other language versions of AE, you learn to use match names because they're the same in all language versions, and, they're unique for each parameter. I use a wonderful script called rd_GimmePropPath.jsx by Jeff Almasol to collect the match names, but I don't know if it's still available anywhere.

You can throw together a quick script like this, which will give you the match names for all selected parameters:

function getProps(){
	var comp = app.project.activeItem;
	if (! comp || ! (comp instanceof CompItem)){
		alert ("No comp active.");
		return;
	}
	var props = comp.selectedProperties;
	var txt = "";
	for (var i = 0; i < props.length; i++){
		txt += '"'+props[i].name + '"    "' + props[i].matchName + '"\n';
	}
	alert (txt);
}
getProps();

1 reply

Dan Ebberts
Community Expert
Community Expert
October 27, 2024

What do you mean by "nested"? If you're talking about parameter groups (with the little twirly things to expose parameters within), I think you just ignore the outer parameter names and use the inside parameter names directly.

Participant
October 27, 2024

Yes, grouping is what I meant, thank you.
So how would that work if grouped items had the same name, for example, there might be "Intensity" under "Composite noise", but also there might be an "Intensity" under "Luma noise"?

Dan Ebberts
Community Expert
Community Expert
October 27, 2024

For reference, which plugin are you referring to?