Search found 23 matches

by axymark
January 26th, 2014, 12:33 pm
Forum: Scripts Discussion
Topic: Get all parent folders to project root
Replies: 3
Views: 10901

Get all parent folders to project root

Hello, I need to figure out where an item resides inside my project. I can get parent folder with app.project.item(index).parentFolder and could loop my way through until i hit the Root but i'd rather not if there's a better way. So, to be precise, if i have: Project Root |-- Folder1 |-- Folder2 |--...
by axymark
January 18th, 2014, 9:05 am
Forum: Scripts Discussion
Topic: Check if project is saved
Replies: 0
Views: 7238

Check if project is saved

Hi,

How do you check if the project has been changed since the last save?
(visually represented as the little asterisk in the title area...)

Thanks
by axymark
December 6th, 2013, 1:34 am
Forum: Scripts Discussion
Topic: Reference a variable in an expression
Replies: 2
Views: 10324

Re: Reference a variable in an expression

Yeah, just brake the expression string with quotation marks. var myComp = app.project.activeItem; var myLayer = myComp.selectedLayers[0]; var myLayerName = myLayer.name; var myNull = myComp.layers.addNull(myComp.duration); myNull.name = myLayerName + " Wiggle Control"; var SliderXFrequency...
by axymark
December 4th, 2013, 1:56 am
Forum: Script requests
Topic: Project report script
Replies: 2
Views: 10708

Re: Project report script

Hi, Waking the thread to check if there's some more info on this. I don't want to use a third party script. Alternatively, i suppose it shouldn't be too hard making a complete script that will mimic the process. Does anyone know exactly what generated report contains (or could provide a relevant rea...
by axymark
December 2nd, 2013, 5:41 pm
Forum: Scripts Discussion
Topic: Check if selection is a project item or a layer
Replies: 7
Views: 21099

Re: Check if selection is a project item or a layer

Yup, that works. Just needed an uppercase "L" in numLayers but easy enough to spot. For anyone who happens to stumble upon this thread in the future: var activeItem = app.project.activeItem; var compActive = false; var numLayers = activeItem.numLayers; app.executeCommand(2767); // New Null...
by axymark
December 2nd, 2013, 3:29 pm
Forum: Scripts Discussion
Topic: Check if selection is a project item or a layer
Replies: 7
Views: 21099

Re: Check if selection is a project item or a layer

May be an overkill, but it gets me moving forward. How would you check if this particular null was created? I threw something together utilizing markers. var activeItem = app.project.activeItem; var selectedLayer = activeItem.selectedLayers[0]; try { app.executeCommand(2157); // app.findMenuCommandI...
by axymark
December 2nd, 2013, 2:27 am
Forum: Scripts Discussion
Topic: Check if selection is a project item or a layer
Replies: 7
Views: 21099

Re: Check if selection is a project item or a layer

Huh, that's interesting. Your code works perfectly well for me until i have a case when i'm selecting a comp item in project panel that has a layer selected inside. I could have opened up this comp in the past, selected a precomp and than moved on to other things. Later on, when i select a compositi...
by axymark
December 1st, 2013, 3:07 pm
Forum: Scripts Discussion
Topic: Check if selection is a project item or a layer
Replies: 7
Views: 21099

Check if selection is a project item or a layer

Hi. First post here. Novice afterfx scripter, so fair warning in advance. I need to get a name of a composition whether it's selected in the Project window or as a precomp layer in timeline. My pseudocode: var activeItem = app.project.activeItem; if (activeItem is a compItem) { get activeItem name; ...