app.executeCommand(...) List - work in progress (for CS3)

Find out why the . goes before the /

Moderator: Paul Tuersley

sundstedt
Posts: 15
Joined: November 30th, 2007, 8:46 am

January 9th, 2008, 3:37 am

Hi,

Regarding app.executeCommand(...) & app.findMenuCommandId:

Anyone got a complete list of these commands?

Here is the ones I have found out myself so far, I figured people would appreciate such a list. You can use these by typing:

app.executeCommand(..commandID..)

or even better:

app.executeCommand(app.findMenuCommandId("Close"));

..in case these numbers would change (thanks Chris for pointing this out)

Use the numbers after the // below:

alert(app.findMenuCommandId("New Project")); // 2
alert(app.findMenuCommandId("New Folder")); // 2139
alert(app.findMenuCommandId("Close")); // 4
alert(app.findMenuCommandId("Reduce Project")); // 2735
alert(app.findMenuCommandId("Copy")); // 19
alert(app.findMenuCommandId("Paste")); // 20
alert(app.findMenuCommandId("Image Caches")); // 2372
alert(app.findMenuCommandId("New Composition...")); // 2000

alert(app.findMenuCommandId("Text")); // 7016
alert(app.findMenuCommandId("Solid...")); // 3001
alert(app.findMenuCommandId("Light...")); // 2563
alert(app.findMenuCommandId("Camera...")); // 2564
alert(app.findMenuCommandId("Null Object")); // 2767
alert(app.findMenuCommandId("Shape Layer")); // 3736
alert(app.findMenuCommandId("New Mask")); // 2367

alert(app.findMenuCommandId("Glow")); // -3014668 ?

alert(app.findMenuCommandId("Full")); // 2048
alert(app.findMenuCommandId("Half")); // 2047
alert(app.findMenuCommandId("Third")); // 2081
alert(app.findMenuCommandId("Quarter")); // 2046

alert(app.findMenuCommandId("Show Rulers")); // 2280
alert(app.findMenuCommandId("After Effects Help...")); // 2542

Regards,
Last edited by sundstedt on January 9th, 2008, 6:47 am, edited 1 time in total.
User avatar
Atomic
Posts: 157
Joined: April 30th, 2007, 5:55 am
Location: United States, Ohio

January 9th, 2008, 6:37 am

What version of AE do these commands work with?

Is this CS3 only?
sundstedt
Posts: 15
Joined: November 30th, 2007, 8:46 am

January 9th, 2008, 6:48 am

Good point Atomic, I have only been using CS3 lately, so these are only tested in CS3. I checked in AE 6.5 for you now and that wasn't supported.
My colleague says it works in 7.0!
Last edited by sundstedt on January 10th, 2008, 2:44 am, edited 1 time in total.
User avatar
monter
Posts: 21
Joined: July 15th, 2004, 1:03 am
Location: Russia, Moskow
Contact:

January 10th, 2008, 2:38 am

Code: Select all

File New 2264
Open Project 3
Open Recent Projects 2284
Browse... 3689
Browse Template Projects... 3692
Clos 4
Close Project 3154
Save 5
Save As... 6
Save a Copy... 2166
Increment and Save 3088
Revert 7
Import 2105
Import Recent Footage 2283
Export 2494
Find... 2607
Find Next 2608
Add Footage to Comp 2005
New Comp from Selection... 2796
Consolidate All Footage 2107
Remove Unused Footage 2109
Reduce Project 2735
Collect Files... 2482
Watch Folder... 2457
Create Proxy 2777
Set Proxy 2106
Interpret Footage 2102
Replace Footage 2237
Reload Footage 2257
Reveal in Explorer 2562
Reveal in Bridge 3690
Project Settings... 2611
Page Setup... 8
Print... 9
Quit 1

Edit
Undo 16
Redo 2035
History 2995
Cut 18
Copy 19
Copy Expression Only 53
Paste 20
Clear 21
Duplicate 2080
Split Layer 2158
Lift Work Area 2613
Extract Work Area 2614
Select All 23
Deselect All 2004

Label 2358
Purge 2370
Edit Original... 2142
Edit in Adobe Audition 3697
Edit in Adobe Sound booth 3761
Templates 2265
Preferences 2079

Layer New 2606
Layer Settings 2021
Open Layer 2015
Open So urce Window 2523
Mask 2040
Mask and Shape Path 3745
Quality 2041
Switches 2053
Transform 2020
Time 3155
Frame Blending 2289
3D Layer 2541
Guide Layer 3081
Add Marker 2157
Preserve Transparency 2190
Blen ding Mode 2162
Next Blending Mode 2781
Previous Blending Mode 2782
Track Matte 2269
Layer Styles 3739
Bring to Front 2016
Bring Forward 2018
Send Backward 2019
Send to Back 2017
Adobe Encore 3082
Create Outlines 2933
Auto-trace... 3044
Pre-compose... 2071

Composition
New Composition... 2000
Composition Settings... 2007
Background Color... 2036
Set Poster Time 2012
Trim Comp to Work Area 2360
Crop Comp to Region of Interest 2997
Add to Render Queue 2161
Add Output Module 2154
Preview 2131
Save Frame As 2233
Make Movie... 2006
Pre-render... 2780
Save RAM Preview... 2125
Comp Flowchart View 2258

Layer
New 2606
Layer Settings... 2021
Open Layer 2015
Open Source Window 2523
Mask 2040
Mask and Shape Path 3745
Quality 2041
Switches 2053
Transform 2020
Time 3155
Frame Blending 2289
3D Layer 2541
Guide Layer 3081
Add Marker 2157
Preserve Transparency 2190
Blen ding Mode 2162
Next Blending Mode 2781
Previous Blending Mode 2782
Track Matte 2269
Layer Styles 3739
Bring to Front 2016
Bring Forward 2018
Send Backward 2019
Send to Back 2017
Adobe Encore 3082
Create Outlines 2933
Auto-trace... 3044
Pre-compose... 2071

View
New Viewer 2039
Zoom In 2092
Zoom Out 2093
Resolution 2037
Use Display Color Management 3704
Simulate Output 3703
Show Rulers 2280
Show Guides 2274
Snap to Guides 2286
Lock Guides 2275
Clear Guides 2276
Show Grid 2277
Snap to Grid 2278
View Options... 2776
Show Layer Controls 2435
Reset 3D View 2642
Switch 3D View 2625
Assign 3D View Shortcut 2624
Switch to Last 3D View 2703
Look at Selected Layers 2834
Look at All Layers 2835
Goto Time... 2076


Effect
Effect Controls 2163
Last Effect 2452
Remove All 2072

Window
Work space 2738
Assign Workspace Shortcut 3707
sundstedt
Posts: 15
Joined: November 30th, 2007, 8:46 am

January 10th, 2008, 2:43 am

Thanks monter for providing a much longer list.
User avatar
monter
Posts: 21
Joined: July 15th, 2004, 1:03 am
Location: Russia, Moskow
Contact:

January 10th, 2008, 11:58 pm

All Codes can be looked here:
Image
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

January 11th, 2008, 11:48 am

keep in mind that some codes changed from 7 to CS3 so I would make sure your script checks which version it's running on before it fires off it's commands..

-Lloyd
sundstedt
Posts: 15
Joined: November 30th, 2007, 8:46 am

January 14th, 2008, 10:12 am

lloydalvarez wrote:keep in mind that some codes changed from 7 to CS3 so I would make sure your script checks which version it's running on before it fires off it's commands..

-Lloyd
That's no problem LLoyd, I know a way around this problem (suggested to me by my friend Chris B).

Just type this:

Code: Select all

app.executeCommand(app.findMenuCommandId("Close"));
(this is an example, exchange "Close" to your intended menu command):

This way it will not matter if the ID number has changed, while you will need to know what the name of the menu command is (which can be read from the menus manually). Actually using this method we don't ever have to worry about the ID number of the commands in the first place :D
ScottHD
Posts: 11
Joined: June 14th, 2008, 9:22 pm
Location: South Carolina

June 15th, 2008, 9:42 pm

Does anyone know why when I use the following code (to invoke the "File|Export|Quicktime Movie..." command):

Code: Select all

app.executeCommand(app.findMenuCommandId("Quicktime Movie..."));
I don't get any result?

All of the other File|Export commands can be called. Such as

Code: Select all

app.executeCommand(app.findMenuCommandId("MPEG-4..."));
I did try

Code: Select all

alert(app.findMenuCommandId("Quicktime Movie...")); 
and the alert window just said "0", (that's a zero).

I'm creating a custom dockable UI for my editors at work and was hoping to be able to call the

Code: Select all

app.executeCommand(app.findMenuCommandId("Quicktime Movie..."));
string inside a simple function. A button would execute the function with an onClick.

Long story, short, I'm having to go through the Export menu because the AE Output Module for Quicktime MPEG-4 movies (not H.264) doesn't give me an "MPEG-4 Audio" (AAC) option. Only through the File|Export|Quicktime Movie... does it give me the "MPEG-4 Audio" audio option.
The resulting rendered file must be a MPEG-4 Video file, with Mpeg-4 Audio, and with a .mov extension, not .mp4. The .mov format and spec requirements are not of my choice but of our clients choice.

I am using Windows not OSX btw.

Awesome site! I've learned alot!
If this needs to go into it's own thread please let me know as this is my first post.

Any help is appreciated!
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

June 26th, 2008, 2:00 pm

Does anyone know the command for "Save frame as... Photoshop layers"?
ScottHD
Posts: 11
Joined: June 14th, 2008, 9:22 pm
Location: South Carolina

July 1st, 2008, 8:38 pm

I just tried the

Code: Select all

alert(app.findMenuCommandId("Save frame as..."));
and it gave me 0 (zero) as the resultant in the alert.

Sounds like the same problem as I have above with the "Quicktime Movie..." command. Some commands I guess just aren't directly accessible in scripting currently.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

July 1st, 2008, 10:56 pm

I tried this on AE CS3:

Code: Select all

alert(app.findMenuCommandId("Photoshop Layers..."));
....and it returned 5001. So then I tried these:

Code: Select all

app.executeCommand(5001);
app.executeCommand(app.findMenuCommandId("Photoshop Layers..."));
Either of them will bring up the "Save Layered File As" save window, but I'm not sure if it's possible to get the script to control this save window.
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

July 2nd, 2008, 6:44 am

Last year I wrote a script to batch save frames as photoshop layers, here's that script:

http://aescripts.com/scripts/SaveFrames ... rs.jsx.zip

problem is, as Paul pointed out, the save dialog box is not controllable so you need to either hit OK but hand or have some sort of system key macro or script acknowledging the save dialog box..

-Lloyd
byronnash
Posts: 321
Joined: July 7th, 2004, 2:30 pm
Location: Charlotte, NC
Contact:

July 2nd, 2008, 7:44 am

Thanks for the help guys. I ran into a related problem now though. The comp I would like to save as photoshop is created by duplicating an existing comp. I don't think there will be a way to set the activeItem in scripting right?
User avatar
lloydalvarez
Enhancement master
Posts: 460
Joined: June 17th, 2004, 9:27 am
Location: New York City, NY
Contact:

July 2nd, 2008, 7:49 am

You don't need to, you can refer to your new comp by setting it up as a variable.. check out my magnum script for reference.. I create a temporary comp that I do all my work in and then delete it when I'm done.. the script is pretty well commented so hopefully it should be easy to follow..

-lloyd
Post Reply