YearJingleAdder script

Like most stations (?), I have a set of ‘year’ jingles, in my case spanning 1950 to 2020 (plan ahead! :D), which I might want to play before an ‘oldie’ from that year.

I also take care to ensure that all my MP3s are tagged with a Year BEFORE adding them to mAirList: which ‘picks up’ those tags and helpfully adds a Year Attribute to each item in my mAirListDB database.

So I thought: looking up the year for a track is a minor pain, and I might want to add a ‘year’ jingle just ahead of it, and maybe even Link the ‘year’ jingle in the Playlist to the item. And this naturally led me to writing a script to do exactly that job.

This turned out to be fairly simple to write, so I’ve attached my finshed (but fully-customisable, as always!) script. The only minor limitiation is that it will ONLY work on the NEXT item in the Playlist, because (unless Torben knows otherwise?) scripts have no way of knowing which Playlist item is ‘currently selected’ (that is, the highlighted one in the Playlist); or indeed, how many items are currently selected (my script would need to check that only ONE item is selected before doing anything!).

Note that you WILL need to edit the script before you try to run it.

All you need to use the YearJingleAdder script are:

  1. Items which are tagged (in the Playlist, database, MMD file, or a mAirList custom tag within the audio file) as either Music or Instrumental, and which have a Year attribute.

  2. A consistently-named of ‘year’ jingles (all named ), all stored in the SAME folder on disk.

  3. My script. Add it to your Actions menu if you like it. :wink:

To use the script (AFTER you have edited it to suit your setup), make sure the item you want to add the jingle ‘in front of’ is currently the item marked NEXT in the Playlist, and that the Playlist is in ASSIST mode, then run the script. The correct jingle will be added before the original NEXT item, ready to play. The script always writes a message to the System Log to tell you what happened, so check the status bar after you run the script if anything doesn’t work as expected.

Note that at present, the script dumbly Inserts the jingle file without any checks, so if the jingle file it tries to Insert is misnamed or missing, the script will crash. Other than that, yes it does check for things like year out of range of the jingles available, non-numeric ‘Years,’ etc. ;D

Enjoy!

BFN
CAD


YearJingleAdder.mls (5.43 KB)