AE ENHANCERS

Expressions/Scripts/Presets
It is currently Thu May 23, 2013 2:09 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: app.executeCommand for New Comp Problem
PostPosted: Thu Apr 29, 2010 9:48 am 
Offline
User avatar

Joined: Tue Apr 06, 2010 12:35 pm
Posts: 1
Location: Los Angeles, CA
Hello,

I am trying to figure out a rather wierd/frustrating problem... I have a script that uses app.executeCommand(2796) (for "New Comp from Selection...") and it works just fine and dandy when I run the script from "Run Script File" but does not when I run it from the UI panel I have.

Has anyone run across this problem or know of a fix? I suspect it has something to do with this specific command in the UI panel but I cannot figure out what. By the way, I am able to issue other commands via app.executeCommand and they work fine from my UI panel.

Thanks,
Philip

_________________
Philip
http://www.philiprowe.com


Top
 Profile  
 
 Post subject: Re: app.executeCommand for New Comp Problem
PostPosted: Wed May 05, 2010 5:48 am 
Offline
Enhancement master
User avatar

Joined: Thu Jun 17, 2004 9:27 am
Posts: 456
Location: New York City, NY
Hey Philip

app.executeCommand is an unsupported function, or a "private api" as Apple calls them so it's best to avoid using it as there is no guarantee that it will work. I use it only when there is not other option. In the case of New Comp from selection, it is very easy to do that through standard api's:

Code:
var projSelection = app.project.activeItem;  //the selected item in the project window
var myComp = app.project.items.addComp(projSelection.name, projSelection.width, projSelection.height, projSelection.pixelAspect, projSelection.duration, projSelection.frameRate); //Create a new comp with the same dimensions as the selected item
myComp.layers.add(projSelection); //add the item to the newly created comp


-Lloyd

_________________
http://aescripts.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group