cancel
Showing results for 
Search instead for 
Did you mean: 

Tagging Files in a folder with the name of the folder

bharat_bang
Champ in-the-making
Champ in-the-making
Please help me to write a script that can help me to tag file in a folder with its folder name and its parent folders as well..
:roll:
So if a fil in the folder hierarchy
Multimedia—> Audio—> Song.mp3

The song.mp3 file will have tags Multimedia and Audio
1 REPLY 1

jpotts
World-Class Innovator
World-Class Innovator
Given the API documentation, you should be able to figure this out. Here are some hints:

- The parent of a node (the node's folder) can be found by accessing the "parent" property of a node, like this:
content.parent
- Same for the parent's parent.
- The name of a node can be accessed through the name property, like this:
folder.name
- A tag can be added to a node by calling addTag and passing in the name of the tag, like this:
content.addTag('someFolder')

If you try this and fail, please come back with your code and the error message you are receiving and someone will help you.

Jeff