assign custom tag js via script

assign custom tag js via script

Is it possible to assign a custom tag script to an object via script? Point to a specific .js file which is a tag script and attach it to an object, but via scripting?

Thanks a ton in advance

-Chris G
 
Is it possible to assign a custom tag script to an object via script? Point to a specific .js file which is a tag script and attach it to an object, but via scripting?

Thanks a ton in advance

-Chris G

Yes.

Assume you have the object already, you would do the following:

Code:
    scripttag = object.addTagOfType(SCRIPTTAG);	
    var prepath = doc.scriptPath().match(/(\/Users\/[-\w^&'@{}[\],$=!#().%+~ ]*\/)/g);
    var file = new File(prepath + "Library/Application Support/Cheetah3D/Scripts/Library/" + "foobar.js");
    scripttag.setParameter(“scriptName", file);

I’m not exactly sure I completely understand how to use scripts on objects, but I DO know how to add tags! :rolleyes:
 
Yes.

Assume you have the object already, you would do the following:

Code:
    scripttag = object.addTagOfType(SCRIPTTAG);    
    var prepath = doc.scriptPath().match(/(\/Users\/[-\w^&'@{}[\],$=!#().%+~ ]*\/)/g);
    var file = new File(prepath + "Library/Application Support/Cheetah3D/Scripts/Library/" + "foobar.js");
    scripttag.setParameter(“scriptName", file);
I’m not exactly sure I completely understand how to use scripts on objects, but I DO know how to add tags! :rolleyes:

Many thanks & happy holidays!
 
Back
Top