Tagging Files in a folder with the name of the folder
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2012 03:18 AM
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
:roll:
So if a fil in the folder hierarchy
Multimedia—> Audio—> Song.mp3
The song.mp3 file will have tags Multimedia and Audio
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2012 04:05 PM
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:
- The name of a node can be accessed through the name property, like this:
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
- 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
