Page 1 of 1
Overide default tags with custom Finder tags using Presets?
Posted: 14 Oct 2024, 14:23
by cheaters
Howdy,
I use presets and I know there is an option to "Post Process" with "Set Finder tags" but I want to override and customize the tags.

Can I customize tags in my Preset to override the default tags?
OR

Do we need to create a User Script? If so can we override the defaults you have created and what would that look like?
Thank you sir
Re: Overide default tags with custom Finder tags using Presets?
Posted: 14 Oct 2024, 17:09
by rednoah

The
Set Finder Tags feature is configurable via the
apply.finder.tags system property:
Shell: Select all
filebot -script fn:properties --def apply.finder.tags='{genre}|{y}|{hd}'

You may prefer to use the standalone
xattr script to generate / re-generate macOS Finder tags as needed:
Console Output: Select all
$ filebot -script fn:xattr /path/to/input --action import --format '{genre}|{y}|{hd}'
...
[IMPORT] Write tag plist to xattr [com.apple.metadata:_kMDItemUserTags]: <plist version='1.0'>
<array>
<string>Action</string>
<string>2018</string>
<string>SD</string>
</array>
</plist>
EDIT: Looks like
--format wasn't configurable.
Fixed for this use case.
Re: Overide default tags with custom Finder tags using Presets?
Posted: 14 Oct 2024, 17:46
by cheaters
I don't understand... TMLI5
My Renaming Preset looks like this:
Code: Select all
/Volumes/Media_2/Plex/Series/
{ ~plex.year.id.derive { allOf { tags }{ vf }{ source }
{ "${ vcf}_${ hd }_${ bitdepth }_${ acf }" }
{ info.network } .joining('][', ' [',']') } }
{ if (dc > 1) '_'+di }
OR
User Scripts:
Rename>Options>Post Process>User Scripts
I think you are showing me shell/terminal commands and that's not how I am currently renaming files.
Putting any of that code in the User Script for post processing fails with an error and I don't see how to add any of it to my existing renaming preset.
FileBot
Syntax Error: Unexpected input: 'def'
I am not sure how to incorporate your change to the base code. Do I have to redownload FileBot?
Re: Overide default tags with custom Finder tags using Presets?
Posted: 14 Oct 2024, 18:01
by rednoah
cheaters wrote: ↑14 Oct 2024, 14:23
I use presets and I know there is an option to "Post Process" with "Set Finder tags" but I want to override and customize the tags.

What exactly would you like to do? What tags do you want?

The example above assumes that we want macOS Finder tags for
"genre", and
"year", and
"video quality", and FileBot naturally re-uses the format engine that you know from generating file paths to generate |-separated tags
(e.g. {genre}|{y}|{hd}) instead. This makes
configuration easy.

Notably,
none of the above is about
Custom Post-Processing Scripts. The
Set Finder Tags built-in post-processing action is configurable. You therefore don't need to write custom tagging code. You merely configure
Set Finder Tags to generate the tags you want.
Re: Overide default tags with custom Finder tags using Presets?
Posted: 14 Oct 2024, 18:05
by cheaters
It's more that I am confused on where to put the code you suggested above.
Does that go in a User Script in Post Processing or can it be used in a Preset?
Re: Overide default tags with custom Finder tags using Presets?
Posted: 14 Oct 2024, 18:10
by rednoah
1. Open the
Terminal app.
2. Run the following
filebot command:
Shell: Select all
filebot -script fn:properties --def apply.finder.tags='{genre}|{y}|{hd}'

This will create the appropriate configuration file at the appropriate file path. You could create and edit this configuration file manually. Running the command above will do it for you, and explain how you could have done it yourself if you so wanted.
Re: Overide default tags with custom Finder tags using Presets?
Posted: 14 Oct 2024, 18:27
by cheaters
Thank you!
My misconception was there was a way to do this on a "per-run" basis
Re: Overide default tags with custom Finder tags using Presets?
Posted: 14 Oct 2024, 18:36
by rednoah
You set the configuration once, and then
Set Finder Tags will work differently from there on.
cheaters wrote: ↑14 Oct 2024, 18:27
My misconception was there was a way to do this on a "per-run" basis
There is unfortunately no way to do this on a per-run basis easily. Possible with
Custom Post-Processing Scripts of course, but you'd have to write the entire code yourself
(i.e. you cannot re-use the built-in Set Finder Tags code) so not recommended / feasible for a typical less code-savvy user.
In regards to the OP,
Apply Post-Processing Features are generally unrelated and independent of
Presets. Clicking on a
Presets will not enable / disable any currently enabled / disabled post-processing features.
EDIT:
I've added a
Generate custom Finder tags example. Requires FileBot r10422 or higher.