Tinderbox Forum

Add a Key Attribute to hundreds of files

Hi - I imported a discography from a database and I now want to link each entry with the corresponding audio file. I know I can do this by dropping the file into the General:File Key Attribute, which I access by using the Add Key Attribute button in Outline view (otherwise it will not display since it is empty).
I have to repeat this procedure hundreds of times, including the Add Key Attribute which takes several steps (pull down menus), and I wonder if there is a way to do this efficiently.

The easiest way to add the File to key attributes is to use a prototype. Simply create the prototype, add File to the key attributes and then assign it to the other notes all at once.

However, depending on how you imported the database, your notes may have local key attributes that keep the prototype from setting them for the notes. If that’s the case, you could create a stamp that reads:

$KeyAttributes=;

and apply it to all the notes. This will reset the key attributes and allow the prototype to set them.

That only gets you halfway to where you want to be, but I’m not sure how to automate attaching files to notes (or if it’s possible).

2 Likes

Thanks for replying.
Let’s see, my notes have several User attributes: the track name is the Name of the note, but the rest of the discographical entry (Album, Artist, Composer, etc) show up as User Att’s.
I tried converting the first of these entries into a Prototype but that does not seem to do the trick.
All I want is to be able to see the attribute so that i can drop the file in there, I agree there is no way around that, but having to search for the attribute to display in each note is what is holding me back.
I’ll try what you are suggesting w Agents.
Thanks
Pablo

Further to the last, you might want to look at AppleScript. Once your Key Attributes are fixed the remaining task involves data outside Tinderbox and thus outside the reach of action code (runCommand() notwithstanding.

That said, $File can be set via action code. So, if your existing notes have the necessary information to allow you to 'calculate) the OS file path than you could set these links using a an agent or stamp. If you do go this route, do a small experiment first before letting rip on the whole TBX as there will be less cleaning up to do if you inadvertently make a mistake.

thanks again.
Yes, I can see how this could be scripted (although a little over my head right now) because my file names bear relationship with the entries (there is a catalog number).
But I am still not understanding how to get the File attribute to show up (blank) when I look at the note. I select a range of notes and the Add Key Attributes button disappears.
I tried creating a stamp as suggested above, but it wiped out the rest of the User attributes and I don’t know how to get them back other than importing the table again.

My suggestion would be to create a new prototype. The easiest way to do this would be to import one of the built in prototypes. Then to go to the prototype container and create a new note. This note will automatically become a prototype. For that note, click on the “+” button and add any key attributes you want: all the user attributes and also the file.

Once this is done, select all the notes you’ve imported and assign them that prototype. (How you do this varies based on the view.)

Because you have reset the key attributes of these notes with the stamp all the key attributes of the prototype will now be applied to them.

ok, I understand how this works, I followed your instructions, and even though the notes are now using the new Prototype, they have not inherited the Key Attributes I set for the Prototype.

Here is the Prototype “Reference” with the Key Attributes I want displayed and in the order I want them displayed. The Entry “Corrientes y Esmeralda” does not reflect this.

I’m guessing your key attributes list is locally set and needs to be reset to the default so the prototype can set them.

To do this:

  1. select all the imported notes at once
  2. go to quickstamps (Stamps->Quickstamps)
  3. click the button with a down arrow labelled “default.”
  4. click apply

2 possibilites:

  • The notes are using the wrong attribute
  • You haven’t reset the notes’ $Key Attributes correctly
1 Like

One addition: the button may be labelled either “default” OR “inherited.” The label changes based on context.

2 Likes

Yeah that’s it!
I went back and reset the notes’ $KeyAttributes as described above and now it’s all there.
Thank you!!
Pablo

2 Likes