[Script] Generate custom Finder tags

Running FileBot from the console, Groovy scripting, shell scripts, etc
Post Reply
User avatar
rednoah
The Source
Posts: 23922
Joined: 16 Nov 2011, 08:59
Location: Taipei
Contact:

[Script] Generate custom Finder tags

Post by rednoah »

This post-processing script will generate custom macOS Finder tags:

Groovy: Select all

{ source, target ->
	// custom list of tags
	def tags = allOf{ y }{ hd }{ genre }

	// write plist to xattr
	target.xattr.'com.apple.metadata:_kMDItemUserTags' = XML{
		plist(version:'1.0') {
			array {
				tags.each{ string(it) }
			}
		}
	}
}
Screenshot
:idea: Please read the FAQ and How to Request Help.
Post Reply