Adding OSX colour tags to files using a Worker action
This document provides the user with guidance on setting a Worker action (OSX only) to add colour tags to a files via a Python script.
As a prerequisite to this exercise you must have Python installed on you workstation, which can be downloaded from the following link: – https://www.python.org/downloads/mac-osx/.
You will also require a copy of the Python script that will be called by the Worker to rename the files. This can be downloaded from the following link: ftp://support.squarebox.com/pub/download/tagfile.py.zip.
The first step is to create an appropriate tag field; in this example user defined field “User1” is configured to read “FileTag”.
Create a pick list for this field; in the example shown the colours “Red”, “Green” and “Blue” were added to the pick list.
Select three media files and assign them each a unique colour FileTag from the pick list that you previously created.
Publish the changes to the server.
Review the files in the Finder utility to check that they have not already been tagged.
Open CatDV Worker and create a new Worker job if one does not exist already.
Configure your server settings if required.
Now create a new Server Query and add job name and description details, click the visible tick box.
On the Server Query tab, under Query Terms add your user defined field from the pick list, in this instance “User 1”, click the “NOT” tick box to the left of it and set the option to the right of it to “is blank”. This is effectively telling the Worker job to ignore all files where the user defined variable is blank.
In the Processing Steps tab add another processing step by clicking the plus button. This will open up another window. Select “Execute Command” from the pick list.
Key in the additional command details in the “Command Line“ window as demonstrated below; where tagfile.py is the Python script which carries out the tagging routine, ${U1} represents User Field 1 and $b points the Worker to the original directory path.
In the Publish tab set the “Publish to Server” option to Publish changes, set “Media Path = “to last copied/moved file” and set “Extra fields” to the name of the user defined variable. Click OK to go back to the main Edit Configuration window.
In the Watch Actions tab click apply.
The Worker will now process the newly created job and add tags to files to the files that were selected earlier on in this tutorial.
You can verify the changes by opening up the directory with the Finder Utility to see whether the tags were added to the files.