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

Scripting - app.executeCommand(3000)

Participant ,
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

1.0K

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

Participant , 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'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.

Votes

Translate

Translate
LEGEND ,
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

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
Participant ,
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!

 

 

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
Participant ,
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.

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

Copy link to clipboard

Copied

Nice! Glad that post was helpful 👍

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
Participant ,
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

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 ,
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.

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
Participant ,
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!

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