Question

I've been struggling with a little script that should be easy to implement: I've added a rule on a folder that runs a script. The script should get the folderlocation of the uploaded or incoming document and add the location as a tag:

var url = document.properties.locale.nodeRef;
document.addTag(url);

It should be something like this, but this doesn't work. how should I do it?

Was it helpful?

Solution

Your code should be as follow.First try with my code then just replace logic to add path.

if (!document.hasAspect("cm:taggable"))
document.addAspect("cm:taggable"); 
 document.addTag("test");

You can replace "test" with accessed path of your document.

OTHER TIPS

As @gagravarr says you should save changes. But I think the correct statement is

document.save();

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top