Copy link to clipboard
Copied
Hi,
I'm trying to set a marker on a composition timeline with a script but... I can't do it.
I easily create a marker on a layer in my composition, I easily create a marker on my composition when nested in an other comp, but I just don't find how to say, "Hey, I just want you tu put a marker on top of everything", just when you hit the " * " on your keyboard with no layer selected.
Can anyone help me ?
Thx,
See ya.
--- EDIT ---
I totally missed it when I first searched on the forum, but I found this thread : http://forums.adobe.com/thread/496748?tstart=180
Two years ago, my request was impossible to solve, is it the same now ?
---
I just found, while doing something else, that in CS5 (not sure how far back it goes) you can move the timeline cursor by using .time.
myComp.time = 4; //Moves cursor to 4 seconds.
So if you were point script to your comp, deselect all layers, then loop through your marker times, move the cursor to that time, then run the executeCommand() code I mentioned above, you could make your task possible.
Copy link to clipboard
Copied
You could use the executeCommand() method with the findMenuCommandId() method:
app.executeCommand(app.findMenuCommandId("Add Marker"));
This will trigger the adding of a marker as if you clicked the option in the dropdown menus within the app. The only issue with this is it will only place a marker where the current timeline cursor is, so it would be limiting as I think you can't move the cursor itself via scripting.
Copy link to clipboard
Copied
I just found, while doing something else, that in CS5 (not sure how far back it goes) you can move the timeline cursor by using .time.
myComp.time = 4; //Moves cursor to 4 seconds.
So if you were point script to your comp, deselect all layers, then loop through your marker times, move the cursor to that time, then run the executeCommand() code I mentioned above, you could make your task possible.
Copy link to clipboard
Copied
Hey,
It works just fine ! Thx for the help. I wouldn't have find it alone !
Copy link to clipboard
Copied
Just remember that I think Lloyd Alvarez posted somewhere that using the executeCommand function is not the most stable way to go about something. Although if it works, it works.
Copy link to clipboard
Copied
Just remember that I think Lloyd Alvarez posted somewhere that using the executeCommand function is not the most stable way to go about something. Although if it works, it works.
Very true, it only acts like a user went and clicked a menu item, but if the same name exists more than once, it can get confused. For the most part though it holds up.
Copy link to clipboard
Copied
What do you mean when saying "if the same name exists" ? If the same menu item exists ?
Copy link to clipboard
Copied
What do you mean when saying "if the same name exists" ? If the same menu item exists ?
Yes, for example "File > Import > File..." and "Composition > Save Frame As > File...", both are labeled as "File..."
app.executeCommand(app.findMenuCommandId("File...")); Wouldn't know which one you are talking about.