Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all 2143 articles
Browse latest View live

Centering the anchor point

$
0
0

Is there an easy way to set the anchor point of a layer right in its center using script?

 

Currently, my script adds text layers to the active composition and styles the text. The things is I need the anchor point to be straight in the middle of the layer to make some position calculations.

 

By default, it seems to be set to the center/bottom of the text. (X/Y)

 

Thanks in advance


Working on a script converting all possible shape layer shapes to masks need feedback

$
0
0

Hi everyone

 

First post here in this forum (I already posted this on the forum at creative.com but since I haven't received any feedback I allow myself to post it here as well).

 

I'm currently working on a script to that converts any kind of possible shape from a shape layer to masks. My initial motivation to start creating the script was, that I had some complex shape layers with a lot of different kind of shapes on them that I wanted to convert to masks so they could be imported into Element 3D. After a lot of googling and searching I realized that such a script doesn't exist (prove me wrong). A script to convert a simple closed shape path made with the pen exists, but not a script that can convert any possible shape in a comp to masks 1:1.

 

So what I'm working on is a script replicating (if so) every possible (convertible) parameter, feature whatever like:

Strokes including width, butt caps, colors, dashes.

Rectangles, circles, ellipsis, rounded rectangles, polygons, stars etc.

 

Right now I have an alpha version but I'dd like to get some feedback of my idea and if you think it would be a good tool to add to the AE-toolbox of scripts. What do you think of this idea?

 

Best Regards

Hans Christian

Adobe After Effects Scripting

$
0
0

Hello, I want to build plugins/scripts for Adobe After Effects, something like 'Montage Library by Nitrozme(https://videohive.net/item/montage-library-most-useful-video-presets/21492033 )'. I researched google and found some references like these:

 

 

What conclusion I came across that it would need JSX(extended Javascript) for building up the scripts. I need some suggestions on how to get started with proper scripting and follow-ups.

 

Thanks.

Array .onClick

$
0
0

I have a few array groups of icon buttons. These all work fine.

 

My array .onClick works fine apart from one small detail.

 

 

   for(var i = 0; i <= 1 ; i++ ){

        b[i].onClick = function(){

        {

        // create an undo group

        app.beginUndoGroup("AddEffect");

        var curItem = app.project.activeItem;

        var selectedLayers = curItem.selectedLayers;  

        try{

        var curRem = curItem.selectedLayers[0].effect.property("Fill").remove();

        var curLayer = curItem.selectedLayers[0].Effects.addProperty("ADBE Fill")("Color").setValue(pcolor[i])

        }catch(err){

        var curLayer = curItem.selectedLayers[0].Effects.addProperty("ADBE Fill")("Color").setValue(pcolor[i]);

        }   

        // close the undo group

        app.endUndoGroup();

        }

    }

}

 

pcolor[I] doesn't work and every time I've managed it to. It goes for the highest number. In the above expression. I only need to reference two buttons that I would click, but how do I get the number of which button I have clicked to use in pcolor[I].

 

I've tried several ways and either it adds fill, but without a using a colour from the array. it adds fill and uses the highest number available. In the above case [1]. Or it does do anything.

 

Any suggestions on how I can reference the onClick to give me a number back?

 

Message was edited by: Scott McGee

After Effects: path format of AVLayer->FootageItem->File

$
0
0

I want to read the file string for a footage item.

 

This string is listed as "FootageItem file attribute" in http://blogs.adobe.com/wp-content/blogs.dir/48/files/2012/06/After-Effects-CS6-Scripting-G uide.pdf?file=2012/06/After-Ef…

 

If I import something like:

 

c:\assets\myfile.png

 

into my composition, the Data Browser shows:

 

/c/assets/myfile.png

 

How does the "c:" get munged into "/c/" and how can I get the original string back? I need to extract this string programmatically and make use of it elsewhere, but I don't want to guess how to "demunge" it.

ADBE Text Document boxTextSize attribute

$
0
0

Hello,

 

I am trying to determine the size and position of a text box in a text layer.

 

the attribute "boxTextSize" works as expected, I am able to retrive the size of the text box with a call like this :

 

myLayer.property(\"ADBE Text Properties\").property(\"ADBE Text Document\").value.boxTextSize;

 

But how can I determine the origin of the text box relative to the anchor point (or vice-versa) ? Strangely, when I create the text box in After Effects (CC), the anchor point is automatically placed in the center of the box (visually), even though the reported numerical values for the anchor point for that layer are (0, 0, 0). Am I misinterpreting something ?

 

Thanks !

Steph

3D Camera Keyframes "Null is not an object"

$
0
0

I am attempting to use script to create keyframes for the 3D camera's position and point of interest. It gets through the script just fine until it hits the line prop3.setValuesAtTimes(addTheseKeysPoint,keyValuesPoint); towards the end for the Point of Interest keyframes and I get the "null is not an object" error. Anybody know what I'm doing wrong? Here is the script:

 

var prop1 = app.project.item(10).layer(2).property("ADBE Transform Group").property("ADBE Position");

var fourKeys = 9;

var addTheseKeysCursor = new Array(1,2,3,4,5,6,7,8,9);

var keyValuesCursor = new Array([487,108],[487,108],[190,151],[190,151],[372,180],[372,180],[655,266],[655,266],[48 5,29]);

 

 

var prop2 = app.project.item(10).layer(1).property("ADBE Transform Group").property("ADBE Position");

var positionKeys = 11;

var addTheseKeysPosition = new Array (1,2,3,4,5,6,7,8,9,10,11);

var keyValuesPosition = new Array ([375,217,-2667],[375,217,-2667],[252,217,-1633],[252,217,-1633],[375,217,-1633],[375,217 ,-1633],[511,217,-1633],[511,217,-1633],[511,129,-1633],[511,129,-1633],[375,217,-2667]);

 

 

var prop3 = app.project.item(10).layer(1).property("ADBE Transform Group").property("ADBE Point of Interest");

var positionKeys = 11;

var addTheseKeysPoint = new Array (1,2,3,4,5,6,7,8,9,10,11);

var keyValuesPoint = new Array ([375,217,0],[375,217,0],[252,217,0],[252,217,0],[375,217,0],[375,217,0],[511,217,0],[511 ,217,0],[511,129,0],[511,129,0],[375,217,0]);

 

 

app.beginUndoGroup("Keys");

 

 

prop1.setValuesAtTimes(addTheseKeysCursor,keyValuesCursor);

prop2.setValuesAtTimes(addTheseKeysPosition,keyValuesPosition);

prop3.setValuesAtTimes(addTheseKeysPoint,keyValuesPoint);

 

app.endUndoGroup();

 

alert("All Done");

Trying to recursively loop through comp to find all color controls

$
0
0

Hey guys, new to scripting. I'd like to be able to crawl through my comp and identify any visible color controls (whether inside stroke or fill, for text, or color expression controls, etc.) to either .push() into an array or to modify each by appending an expression to it. I've modified snippets given by Horshack and Dan Ebberts (thanks btw!) and am successfully combing through every property of every layer of my comp, but I'm also returning hidden colors that I'd like to not have plus I'm getting some odd errors:

 

//  find / replace parameters are for names, not relevant at the moment
// main("Stroke 1", "Stroke");

var count = 0;
var colorArray = [];

// Horshack @https://forums.adobe.com/thread/2317720
function dumpPropTree(rootObj, nestingLevel, find, replace) {
    var countProps = rootObj.numProperties;    for (var propIndex=1; propIndex <= countProps; propIndex++) {        var prop = rootObj.property(propIndex);        if (prop.name === find) {          prop.name = replace;        }        var type = prop.propertyValueType;  /////// Color:        switch(prop.propertyValueType) {          case PropertyValueType.COLOR:            if (prop.canSetExpression) {              var newColor = rgbToHex(prop.value[0] * 255, prop.value[1] * 255, prop.value[2] * 255);               // working:              // alert(newColor);              count++;               // not working:              // colorArray.push(newColor);            }            break;          default:            break;        }  /////// End color        if (prop.numProperties > 0)            dumpPropTree(prop, nestingLevel+1, find, replace);    }
}

function main(find, replace) {
  var activeComp = app.project.activeItem;  var countSelectedLayers = activeComp.layers.length;  for (selectedLayerIndex = 1; selectedLayerIndex <= countSelectedLayers; selectedLayerIndex++) {      var layer = activeComp.layers[selectedLayerIndex];      dumpPropTree(layer, 0, find, replace);  }  // alert("Result is " + colorArray);  // ERROR: Invalid numeric result (divide by zero?)        // But why? There's no division in this code, and hex values are showing correctly?  alert(count);
}


/// https://stackoverflow.com/questions/5623838/rgb-to-hex-and-hex-to-rgb
// componentToHex();
// rgbToHex();

 

When I use this on a comp that has one shape layer with 4 rectangles (each of which having one distinct fill), then I return 13 colors instead of 4, and the extras seem to be for Blending Modes because they're pure white or pure black. I thought .canSetExpression would filter those out since they don't seem to be visible, is there a better way to identify only the visible Color properties, and can I have any pointers on why I'm getting errors trying to push these hex values to a global array? The ideal output  would be returning an array like ["ff0000", "00aa99", "bcbcbc", "323232"], which would be all four (fill/stroke/expression control) colors currently inside my comp.

 

Can I get any help here? I can discriminate the array so only new colors are added to prevent duplicates on my own, but I'm unsure why pushing to this array doesn't work here and how to get only visible colors (and would need these solved before moving on).


How to get keyframe data for Rotation

$
0
0

I am able to get all keyframe data for Position and Scale referencing the item and layer as follows:

 

     var propertyPosition = app.project.item(1).layer(1).property("ADBE Transform Group").property("ADBE Position");

     var propertyScale = app.project.item(1).layer(1).property("ADBE Transform Group").property("ADBE Scale");

 

But, the following always returns null for me:

     var propertyRotation = app.project.item(1).layer(1).property("ADBE Transform Group").property("ADBE Rotation");

 

Any ideas?

Get only x,y keyValue of position keyframes

$
0
0

Hi everybody,

 

I'm trying to copy all keyframes position value of a layer to a point control, but in my array I have 3 dimmensionnal [x,y,z] values and for setValueAtTime in my point control I need just [x,y].

Do you know how to construct my array just with [x,y] values keyframes ?

 

this is my script for now:

    var composition = app.project.activeItem;       var layer01 = composition.layer("01").property("ADBE Transform Group").property("ADBE Position");        var layer02 = composition.layer("02").property("ADBE Effect Parade").property("ADBE Point Control").property("ADBE Point Control-0001");        var keys = []; // Build an array


for (var i = 1; i <= layer01.numKeys; i++) {  keys[keys.length] = layer01.keyValue(i);
} // Copy all values    // Save the time of the first and last keyframe, so the script knows the space where to distribute them
var first = layer01.keyTime(1);
var last = layer01.keyTime(layer01.numKeys);    // Delete all keyframes
while(layer01.numKeys) {  layer01.removeKey(1);
}    // Set new keyframes
for(i = 1; i <= keys.length; i++) {  layer02.setValueAtTime(first + (last - first) / (keys.length - 1) * (i - 1), keys[i - 1]);
}

 

Thank you

Problems with CEP and install bodymovin for adobe Ae 2015

$
0
0

Hello everyone,

I am trying to install this plugin ( bodymovin/bodymovin · GitHub ) which should interface with my 2015 Ae, The software is up to date but I can't find the CEP folder /Library/Application Support/Adobe/CEP/extensions, and I can't understand how to run CEP. In addition the extension manager won't recognize my Ae.

Can you help me please?

Create Master Property with script

$
0
0

Hi

 

Is it possible to create a master property on a comp using scripts?

 

Thanks,

Jakob

Searching for ExternalObject library fails on some macOS systems, why?

$
0
0

Hi There!  I hope all are well, and thanks for taking the time to read through this post.

 

I've got some code that effectively looks for an ExternalObject file on the disk.  The file, let's call it mylib.bundle is stored within /Library/Application Support/MyApp

 

In my ExtendScript code I've got:

 

ExternalObject.log = true;
ExternalObject.searchFolders = "Plugins;Plug-Ins;Frameworks;.;../../../Plugins;../../../Plug-ins;../Frameworks;../../..;/Library/Application Support/MyApp";
var TEST = new ExternalObject("lib:dlic");
$.writeln(TEST);

 

When I look at the ESTK Javascript console, I get the following returned since I set the ExternalObject.log method to true:

 

ExtObj: trying /Applications/Adobe After Effects CC 2018/Adobe After Effects CC 2018.app/Contents/MacOS/Plugins/mylib.bundle

ExtObj: trying /Applications/Adobe After Effects CC 2018/Adobe After Effects CC 2018.app/Contents/MacOS/Plugins/mylib.framework

ExtObj: trying /Applications/Adobe After Effects CC 2018/Adobe After Effects CC 2018.app/Contents/MacOS/Plug-Ins/mylib.bundle

ExtObj: trying /Applications/Adobe After Effects CC 2018/Adobe After Effects CC 2018.app/Contents/MacOS/Plug-Ins/mylib.framework

ExtObj: trying /Applications/Adobe After Effects CC 2018/Adobe After Effects CC 2018.app/Contents/MacOS/Frameworks/mylib.bundle

ExtObj: trying /Applications/Adobe After Effects CC 2018/Adobe After Effects CC 2018.app/Contents/MacOS/Frameworks/mylib.framework

ExtObj: trying /Applications/Adobe After Effects CC 2018/Adobe After Effects CC 2018.app/Contents/MacOS/./mylib.bundle

ExtObj: trying /Applications/Adobe After Effects CC 2018/Adobe After Effects CC 2018.app/Contents/MacOS/./mylib.framework

ExtObj: trying /Applications/Adobe After Effects CC 2018/Plugins/mylib.bundle

ExtObj: trying /Applications/Adobe After Effects CC 2018/Plugins/mylib.framework

ExtObj: trying /Applications/Adobe After Effects CC 2018/Plug-ins/mylib.bundle

ExtObj: trying /Applications/Adobe After Effects CC 2018/Plug-ins/mylib.framework

ExtObj: trying /Applications/Adobe After Effects CC 2018/Adobe After Effects CC 2018.app/Contents/Frameworks/mylib.bundle

ExtObj: trying /Applications/Adobe After Effects CC 2018/Adobe After Effects CC 2018.app/Contents/Frameworks/mylib.framework

ExtObj: trying /Applications/Adobe After Effects CC 2018/mylib.bundle

ExtObj: trying /Applications/Adobe After Effects CC 2018/mylib.framework

ExtObj: trying /Library/Application Support/MyApp/mylib.bundle

[object ExternalObject]

Result: undefined

 

Everything is fine and the "TEST" variable is assigned the ExternalObject just fine. 

 

The problem is that on some users' machines, the string specified in the .searchFolders method of the ExternalObject does not work.  Apparently, on some macOS systems, ExtendScript will search at /Volumes/Library/Application Support/MyApp — effectively appending /Volumes to the actual path where the mylib.bundle file exists.  So, the same code listing above on a different machine produces the following result in the ESTK window:

 

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/ExtendScript Toolkit.app/Contents/MacOS/Plugins/mylib.bundle

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/ExtendScript Toolkit.app/Contents/MacOS/Plugins/mylib.framework

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/ExtendScript Toolkit.app/Contents/MacOS/Plug-Ins/mylib.bundle

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/ExtendScript Toolkit.app/Contents/MacOS/Plug-Ins/mylib.framework

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/ExtendScript Toolkit.app/Contents/MacOS/Frameworks/mylib.bundle

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/ExtendScript Toolkit.app/Contents/MacOS/Frameworks/mylib.framework

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/ExtendScript Toolkit.app/Contents/MacOS/./mylib.bundle

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/ExtendScript Toolkit.app/Contents/MacOS/./mylib.framework

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/Plugins/mylib.bundle

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/Plugins/mylib.framework

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/Plug-ins/mylib.bundle

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/Plug-ins/mylib.framework

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/ExtendScript Toolkit.app/Contents/Frameworks/mylib.bundle

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/ExtendScript Toolkit.app/Contents/Frameworks/mylib.framework

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/mylib.bundle

ExtObj: trying /Applications/Adobe ExtendScript Toolkit CC/mylib.framework

ExtObj: trying /Volumes/Library/Application Support/MyApp/mylib.bundle

ExtObj: trying /Volumes/Library/Application Support/MyApp/mylib.framework

Notice in the red lines, that /Volumes is somehow appended to the /Library path.  However, it really shouldn't be, and the string specifier in the .searchFolders method doesn't have that.  Why does ExtendScript insist on trying at /Volumes/Library... when there is no such directory in the disk system nor is it specified in the code.

 

Any ideas?

 

Thanks,

Arie

How to run a function after another function is complete?

$
0
0

Hi,

 

I'm trying to create a script that imports a file via a dialogue box, and then runs a series of functions after (importing files linked in the CSV, creating comps for each etc)

However with this test below the "test comp" is created before the user can select and import the needed CSV (which will provide specs for the comp etc).

 

Is there a method to sequence the functions so that one runs only once the other is complete? Or another way of solving this?

 

Thanks!

 

~~~~~~~~~Script Example Below~~~~~~~~~~~~

 

 

function csvWindow() {

    var csvPalette = new Window ("palette", "Import CSV");

    var importCSV = csvPalette.add ("button", undefined, "Import CSV - Remember to delete blank colums and rows!");

 

    csvPalette.show ();

 

    importCSV.onClick = ImportCSV ;

 

    function ImportCSV () {

        app.beginUndoGroup("Import CSV");

        if (File.fs == "Windows")

            targetFile = File.openDialog('Import CSV', "CSV* .csv,All files*.*", false);

        else

            targetFile = File.openDialog('Import CSV', function(file) { return file instanceof Folder || (!(file.hidden) && (file.name.match(/\.csv$/i) || file.type == "CSV ")); }, false);

        if (targetFile) {

            var importOptions = new ImportOptions (targetFile);                                                              

            app.project.importFile (importOptions);              

        }

        app.endUndoGroup();

        csvPalette.close ();

      

    }    

}

        function createComp() {

            var currentProject   = (app.project) ? app.project : app.newProject();

            var compSettings     = cs = [1920, 1080, 1, 10, 23.976];

            var defaultCompName  = "test comp"

            var currentComp      = (currentProject.activeItem) ? currentProject.activeItem : currentProject.items.addComp(defaultCompName, cs[0], cs[1], cs[2], cs[3], cs[4]);

            currentComp.openInViewer();

        }

 

app.beginUndoGroup("Gif Script"); // Start undo group

createComp() //Call Function

csvWindow() //Call Function

app.endUndoGroup()

AEFT Script to find duplicate comp?

$
0
0

Hi Friends, I'm new to After effects scripting. Is there anyway to find the duplicate comp using comp name?

 

Thanks in advance


Return values of property after adding expression sliders

$
0
0

Hi there,

 

Today is the first day I started getting into this so the answer to my question might be quite obvious.

 

I am trying to create a script for separating demensions on properties like scale using expression sliders. I found some very similar code and adapted it to my issue.

 

The values automatically jump to 0 though, as that is the default value of the sliders. How can I return the slider values to the original values of my properties?

 

Also through some code I dont quite understand the action happens instantly when clicking it in the dropdown which makes my button useless though I'd like to be able to use it.

 

Thanks already

 

Michael

 

 

 

var mainWindow = new Window("palette", "Separate Demensions", undefined);

 

 

var groupTwo = mainWindow.add("panel", undefined, "");

groupTwo.orientation = "row";

 

 

var twoButton = groupTwo.add("button", undefined, "Click here");

 

 

// All up here is the panel

 

 

twoButton.onClick = function(){

    var differentSlidersForProperties = true; 

 

    var composition = app.project.activeItem; 

    if (!composition || !(composition instanceof CompItem)) 

        return alert("Please select composition first"); 

 

    app.beginUndoGroup("Add Controllers"); 

    forSelectedProperties(addWiggleExpression); 

    app.endUndoGroup(); 

 

    function forSelectedProperties(callback) { 

        var selectedProperties = composition.selectedProperties; 

        for (var i = 0, il = selectedProperties.length; i < il; i++) { 

            callback(selectedProperties[i]); 

        } 

    } 

 

    function addWiggleExpression(property) { 

        if (!property.canSetExpression) return; 

 

        var effectNameSuffix = ''; 

        if (differentSlidersForProperties) { 

            effectNameSuffix = ' (' + property.name + ')'; 

        } 

 

        var layer = getLayerFromProperty(property); 

        var effectsProperty = layer.property("ADBE Effect Parade"); 

 

        var xSliderName = 'X' + effectNameSuffix; 

        var ySliderName = 'Y' + effectNameSuffix; 

 

        if (!hasSlider(xSliderName)) { 

            addSlider(xSliderName); 

        } 

 

        if (!hasSlider(ySliderName)) { 

            addSlider(ySliderName); 

        } 

 

        addExpression(); 

 

        function hasSlider(sliderName) { 

            for (var i = 1, il = effectsProperty.numProperties; i <= il; i++) { 

                if (effectsProperty.property(i).name === sliderName) { 

                    return true; 

                } 

            } 

            return false; 

        } 

 

        function addSlider(sliderName) { 

            var slider = effectsProperty.addProperty('ADBE Slider Control'); 

            slider.name = sliderName; 

        } 

 

        function getLayerFromProperty(property) { 

            while (property.parentProperty) { 

                property = property.parentProperty; 

            } 

            return property; 

        } 

 

        function addExpression() { 

            var expression = 'ctrl1 = effect("' + xSliderName + '")("Slider");  ctrl2 = effect("' + ySliderName + '")("Slider"); [ctrl1,ctrl2];'; 

            property.expression = expression; 

        } 

    } 

}(); 

 

 

mainWindow.show();

JSON is undefined error

$
0
0

I've use JSON.parse() and JSON.stringify() numerous times. For some very odd reason, whenever I try to use JSON now, an error is thrown saying that JSON is undefined.

 

This is a toy example to showcase how strange this is:

 

var jstr = JSON.stringify({obj:12}); // JSON is undefined error here

var obj = JSON.parse(jstr);

alert(obj);

 

 

In AE Scripting guide, it says that it uses  ECMA-262  specification, which includes support for JSON.

 

Has anyone else experience this bizarreness? Is there a fix or should I just bring in my own JSON functions?

 

Select Next Keyframe (in selected property) script

$
0
0

I find myself constantly crafting individual keyframes manually, so being able to automatically select the next/previous keyframe on a selected property with a shortcut (assigned to a script, since there's no such functionality in After Effects, being "Select Previous/Next Keyframes" the closest thing) instead of locating the keyframe and clicking on it, would save me, and everyone, hours of pointing and clicking.

 

After some research I thought It was not possible but after some more (looking at scripts like this AE ENHANCERS • View topic - Exponential Scaling and Re: How can I access the layer keyframes?) , I've started to wonder if it is scriptable.

 

Hope it is clear what I'm trying to achieve;

Basically I'd like that pressing Shift+K would take me to the next keyframe in the selected property AND select it (Shift+J for the previous one) and

pressing Ctrl+Shift+K would select the next keyframe in the selected property without actually moving the Current Time Indicator (Ctrl+Shift+J for the previous one).

 

(I think it makes sense and it is consistent with the almighty J and K shortcuts but I didn't know how to write the code or ask for this functionality. Haven't been lucky asking to fellow animators either).

 

Thanks,

 

Oliver

Create different Composition name every time

$
0
0

Hi,

I'm working on script with expressions which are connected to a composition.

So the composition name has to be different every time a run the script, if I have two compositions with a same name the expressions doesn't work.

The code below is creating the comps: myComp 1, myComp 2, myComp 3. And that's what I want it to do.

But if the user delete some comp the script will create the last comp again in this case myComp 3.

What should I put in this if statement?

Thanks

 

     var compNumber = 0;     var compName;
for (var i = 1; i <= app.project.numItems; i++) {     if (app.project.item(i) instanceof CompItem) {          compNumber += 1;          compName = "myComp " + compNumber +"";           if(compName === app.project.item(i).name) {               // If user delete some comp, here I have to create new "compName" that is different          }     }
}

Get PropertyDepth-Chain as a "Name String"

$
0
0

Hi,

 

I want to dig down a PropertyChain (if that's the right word for it) and get every property along the way as a name in a String.

 

For Example, if I have a Rectangle and open up     Rectangle 1 > Rectangle Path 1 > Size      I want my String to contain (Rectangle 1, Rectangle Path 1, Size).

I can get the information if I type in where it's at specifically with "Contents"(1).name and so on but I want to be able to click on any Property and chase it's trail if that makes sense.

 

Been sitting here for hours and just can't figure it out. I don't know if it is a lot more complex than I believe.

 

Thanks a lot

 

Michael

Viewing all 2143 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>