Batch set FPS?
Moderator: byronnash
Code: Select all
var myItems = app.project.selection;
for (var i = 0; i < myItems.length; i++) {
if (myItems[i] instanceof CompItem) {
myItems[i].frameRate = 11;
}
}
Code: Select all
var myItems = app.project.items;
flo wrote:this will set the framerate of all selected compositions to 11. if you want to change all framerates, change the first line toCode: Select all
var myItems = app.project.selection; for (var i = 0; i < myItems.length; i++) { if (myItems[i] instanceof CompItem) { myItems[i].frameRate = 11; } }
Code: Select all
var myItems = app.project.items;
Hi Flo, thanks for the script! I seem to be able to get the selected comps to work, but when I run the variation of it with all items.
I get an error at the bottom of the script window from ExtendScript stating: After Effects error: Value 0 out of range 1 to 3.
The next box at the bottom says Line 3 Column 1 it is highlighting the third line, but I just copied an pasted your post and it works for Selected items...
Im a noob with scripting, so I dont understand how to change it yet. Please help!
EDIT: btw, I am using CS3 on a Mac.
"We can forgive a man for making a useful thing as long as he does not admire it. The only excuse for making a useless thing is that he admires it intensely. All art is quite useless."
-Oscar Wilde
-Oscar Wilde
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
While the first item in app.project.selection has an index of 0 (as with most arrays), the first item in app.project.items has an index of 1. So the error is saying you've asked for index 0 when the range is from 1 to 3 (the number of items in your project). Another example of this is comp.selectedLayers first index is 0, while comp.layers first index is 1 (which makes sense, as the first layer IS layer 1).
So there are a couple of other changes needed:
So there are a couple of other changes needed:
Code: Select all
var myItems = app.project.items;
for (var i = 1; i <= myItems.length; i++) {
if (myItems[i] instanceof CompItem) {
myItems[i].frameRate = 11;
}
}