It's all about the answers!

Ask a question

How to call a folder in DNG for API script appending name


CJ Giovingo (612) | asked Feb 10 '16, 1:10 p.m.
 I have a script that appends the name of our DNG artifacts based on artifact type and a few custom attributes. I'd like to add a folder call into the name appending script but am not sure out to do it. The folder does not seem to be a part of the RM.Data container in the script catalog. Any ideas?

Here's a snippet from my code:

// Change Names to include abbreviations
changeName = function(ref){
//API Call to get attributes from the artifact
   RM.Data.getAttributes(ref, [RM.Data.Attributes.NAME, RM.Data.Attributes.ARTIFACT_TYPE, RM.Data.Attributes.IDENTIFIER, 'Level', 'System'], function(result){
      var artType, artID, artName, artName2;
      var level, system;
      if(result.code != RM.OperationResult.OPERATION_OK){
console.log("error: ", result);
  }
  else{
      console.log("worked");
    // Build up data to save here
    var toSave = [];
   
    // For each artifact save the attributes that we will need to use or append
    result.data.forEach(function(item){

for(var prop in item.values){

if (prop == RM.Data.Attributes.NAME){
artName = item.values[prop];
}
if (prop == RM.Data.Attributes.ARTIFACT_TYPE){
artType = item.values[prop];
}
if (prop == RM.Data.Attributes.IDENTIFIER){
artID = item.values[prop];
}
if (prop == 'Level'){
level = item.values[prop];
}
if (prop == 'System'){
system = item.values[prop];
}
}


Comments
Donald Nong commented Feb 10 '16, 7:41 p.m.

I checked the RM Extension API specification and could see no "folder" at all. And "parent" does not appear as an attribute either. I guess you're out of luck here.

Be the first one to answer this question!


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.