Adobe 12040118 Using Help - Page 97
Item object, Description, Attributes, Methods, Example
UPC - 718659361808
View all Adobe 12040118 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 97 highlights
Help Using Help Reference Back 97 Type Boolean; read/write. Item object app.project.item(index) app.project.items[index] Description The Item object represents an item that can appear in the Project window. FootageItem, CompItem, and FolderItem are all types of Item. Note that numbering of the index for item starts at 1, not 0. Attributes Attributes name comment id parentFolder selected typeName Methods Reference Description see "Item name attribute" on page 98 name of the object as shown in the Project window see "Item comment attribute" on page 98 string that holds a comment see "Item id attribute" on page 98 unique integer ID for this item see "Item parentFolder attribute" on page 98 parent folder of this item see "Item selected attribute" on page 99 true if this item is currently selected see "Item typeName attribute" on page 99 string corresponding to the type of item Method remove() Reference Description see "Item remove() method" on page 99 deletes the item from the project Example The following example will get the second item from the project and check that the typeName of that item is "Folder". Then it will remove from that folder any top-level item that is a Solid, but only if it is not currently selected. The example will also check to make sure that, for each item in the folder, the parentFolder is properly set to be the correct folder. var myFolder = app.project.item(2); if (myFolder.typeName != "Folder" ) { alert("error: second item is not a folder"); } else { var numInFolder = myFolder.numItems; // Always run loops backwards when deleting things: for(i = numInFolder; i >= 1; i--) { var curItem = myFolder.item(i); if ( curItem.parentFolder != myFolder) { Using Help Back 97