Label

Forum thread started by zuMi on Fri, 2006-07-07 13:22

what about a native way to label files?
like using Tracker's Get Info:

I thought it should work like "People" app about the META:group attribute

Comments

Label

The day we have a labelling tool, how to query for them in a smart way?

An example:
I'm usta to add labels to every application I have in my system, and I have removed symlinks from be menu and substituted them with queries; for each label, like Audio, Video, Tools, Productivity, Networking, I have to run a script similar to this:

#!/bin/sh
#----------------------------------#
# QueryMaker #
#----------------------------------#

ATTR="META:label"

TYPE="text/x-email"

TEMPLATE="E-Mail"

SEARCH_PATH="/boot/home/mail/in"

MAKE_PATH="/boot/home/config/settings/Mail/Menu Links/Labels/"

MakeQueries () {

while read QUERY_NAME; do

touch "$MAKE_PATH/$QUERY_NAME"

addattr -t mime BEOS:TYPE "application/x-vnd.Be-query" \
"$MAKE_PATH/$QUERY_NAME"

addattr -t string _trk/qryinitmime "$TEMPLATE" \
"$MAKE_PATH/$QUERY_NAME"

addattr -t string _trk/qrystr "(($ATTR==\"*$QUERY_NAME*\")&& \
(BEOS:TYPE==\"$TYPE\"))" "$MAKE_PATH/$QUERY_NAME"

done

}

catattr "$ATTR" "$SEARCH_PATH"/* | sed 's/^.*: //g' | tr "," "\n" \
| sort | uniq | MakeQueries

******************************

this script works roughly, it extracts attributes , truncate multiple entries separated by commas, and use all the found values to build a query for each label...but it's not "live", so if I add a brand new label, I add to run again this script, and for a some thousand of files it isn't very pleasant.

The lack of C/C++ skill limited me to that bash script, would be wonderful to have a native way ( a third kind of "magical" query ? ) some day.

Edited: why the rest of the globe doesn't speak italian?