Scripting - app.executeCommand(3000)

Explorer ,
Mar 02, 2022 Mar 02, 2022

Copy link to clipboard

Copied

Hey Guys,

 

I have a button linked to a function. Please see below.

The app.executeCommand(3000) is to launch the create new 'Solid' diagloue box which it does. However when it does this The option to 'make Comp Size' is greyed out. Please see attached image.

 

Is this any reason for this or is there another way to launch that dialogue and to have that option availible? 

 

btnSolid.onClick = function() {
    if (app.project.activeItem == undefined || app.project.activeItem == null) {
        alert("Please Select a Composition");
        return false;
    } else {
        app.executeCommand(3000);
    }
}

 

Solid.png

 

Thanks,

Liam 

TOPICS
Scripting

Views

186

Likes

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

correct answers 1 Correct answer

Explorer , Mar 03, 2022 Mar 03, 2022
Well... that was easy! I had been using some older MenuID document PDF... turns out I was using one of the ID'sthat kind of worked. But there appears to be another one which does work. I changed the ID from 3000 to 2038 This is where I got the resource - https://hyperbrew.co/blog/after-effects-command-ids/ All working perfectly now.

Likes

Translate

Translate
Adobe Community Professional ,
Mar 03, 2022 Mar 03, 2022

Copy link to clipboard

Copied

Well, is the comp window/ timeline actually active? Many functions are contextual and require the window focus to be correct. That's a limitation of the whole process and scripts may particularly suffer from this when not taking care of setting these parameters or when their internal functions switch focus.

 

Mylenium

Likes

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 ,
Mar 03, 2022 Mar 03, 2022

Copy link to clipboard

Copied

Thanks for replying Mylenium. Ah, I see what you are saying. Yes the solid will created but it doesn't actually populate the composition. It only appears in the project panel.

 

Hmmm, I'll have to keep doing some digging. Thanks!

 

 

Likes

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 ,
Mar 03, 2022 Mar 03, 2022

Copy link to clipboard

Copied

Well... that was easy! I had been using some older MenuID document PDF... turns out I was using one of the ID's

that kind of worked. But there appears to be another one which does work.

 

I changed the ID from 3000 to 2038

 

This is where I got the resource - https://hyperbrew.co/blog/after-effects-command-ids/

 

All working perfectly now.

Likes

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
Adobe Community Professional ,
Mar 03, 2022 Mar 03, 2022

Copy link to clipboard

Copied

Nice! Glad that post was helpful 👍

Likes

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 ,
Mar 03, 2022 Mar 03, 2022

Copy link to clipboard

Copied

Yeah it's great to be able to see all of the older versions too. I've been using David Torno's MenuID PDF or I've been searching myself. It's funny though because when you run the app.findMenuCommandId("insertMenuNameHere"); it's not always accurate. It certainly wasn't for the solid.

 

Cheers,

Liam

Likes

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
Adobe Community Professional ,
Mar 03, 2022 Mar 03, 2022

Copy link to clipboard

Copied

Yea for sure, findMenuCommandId() isn't always reliable, and it changes per language as well. The dictionary files are the most reliable method I've found to list them, and then just using the codes per version.

Likes

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 ,
Mar 03, 2022 Mar 03, 2022

Copy link to clipboard

Copied

LATEST

Yeah that makes a lot of sense regarding the languages. I was actually reading how you do this on your site yesterday! Coding, so powerful!

Likes

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