Author Topic: An API (or way to script things)  (Read 1990 times)

zlurg

  • Jr. Member
  • **
  • Posts: 42
  • A very clever text is waiting for you to decypher.
I'd like to write REGEXP scripts for things like renaming errant filenames, correcting keys, swapping tags (cuz MB's isn't very good).

In the iTunes world, there's Doug's Scripts, which are all Applescripts that you can use to manage your iTunes library.  There are a LOT of Doug's Scripts, and I'd like a lot of that functionality in MB.  I request a means to write scripts (in any language) and have them available in pulldowns when managing the library.

I felt this request was specific enough for its own topic.  For individual script ideas, I'd prefer to have those in their own post.

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9351
Have you looked at the Additional Tagging & Reporting Tools plugin? While it's not a scripting plugin, it does do a lot of what you're looking for.
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

zlurg

  • Jr. Member
  • **
  • Posts: 42
  • A very clever text is waiting for you to decypher.
I have it, and it does a bit, but not very much is specific to my addmittedly-unique needs, which is why I'm asking for scripting functionality rather than specific scripts.

Some stuff I'd want to be able to do that Additional Tools doesn't provide:

--delete (x) number of chars from (front | back) of (field)
--swap fields
--move (field) into (field)  <--NOTE, this allegedly already exists, but it does NOT work, see my other post on Key/BPM issues

boroda

  • Sr. Member
  • ****
  • Posts: 4595
I have it, and it does a bit, but not very much is specific to my addmittedly-unique needs, which is why I'm asking for scripting functionality rather than specific scripts.

Some stuff I'd want to be able to do that Additional Tools doesn't provide:

--delete (x) number of chars from (front | back) of (field)
--swap fields
--move (field) into (field)  <--NOTE, this allegedly already exists, but it does NOT work, see my other post on Key/BPM issues

really?

- what do you think ASR preset "Remove given number of characters from beginning/end of <Tag 1>" does?
- what do you think "Swap Tags" command does?
- hmm... it's somewhat tricky  ;D try to apply 2 ASR presets in sequence: "Example: Copy tag", then "Example: Set tag" to erase source tag.
p.s. just in case if you want to completely delete source tag from tracks, there is mb native command: tools> tagging tools> remove tags.

boroda

  • Sr. Member
  • ****
  • Posts: 4595
also, to convert "date" to "year" try ASR preset "Replace full date with year in <Tag 1>".

do you really want to use scripting tools?

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9351
really?

- what do you think ASR preset "Remove given number of characters from beginning/end of <Tag 1>" does?
- what do you think "Swap Tags" command does?
- hmm... it's somewhat tricky  ;D try to apply 2 ASR presets in sequence: "Example: Copy tag", then "Example: Set tag" to erase source tag.
Geez, boroda, you're too damn quick. I had screenshots ready to post but you beat me to it.
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

zlurg

  • Jr. Member
  • **
  • Posts: 42
  • A very clever text is waiting for you to decypher.
This is a bit mean, @boroda

really?

Yes, really.  BTW, I respond better to fewer suggestions that I'm a moron.

- what do you think ASR preset "Remove given number of characters from beginning/end of <Tag 1>" does?

I have no idea.  It's so unintuitive that I haven't been able to get it to work.

- what do you think "Swap Tags" command does?

Yeah, it's the whole "what do you think this does" BS that irks me.  This is a product, not a lifestyle, and we're in the support forums, not the confessional.  This is the right place to ask this and I humbly apologize for not being as awesome at MusicBee as you are.

And what I *THINK* it does is suck.  It does not do what I want, and I've tried it on BPM, Key, Year, and a host of other custom fields.  About the only way Swap Tags works reliably is to copy a tag (custom or not) into Comments, then sort by Comment, manually bulk-retag files, then bulk-delete Comments.

zlurg

  • Jr. Member
  • **
  • Posts: 42
  • A very clever text is waiting for you to decypher.
Alright, @boroda, I attempted to use your helpful suggestion with screenshots to show why that doesn't work for me, and I see the problem:

Until you hit the button that says Install New (preset management), none of the oiptions you mentioned are visible.  After selecting (and saving), I see those options and I will give them a try.

Perhaps those could be pre-loaded instead of no docs saying you need to load them?

Seems like this might be a first-time problem and I'll never have this again with ASR, which means ten years from now I will have forgotten that I had to install that manually when I helpfully suggested some n00b use ASR.

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9351
And what I *THINK* it does is suck.  It does not do what I want, and I've tried it on BPM, Key, Year, and a host of other custom fields.
Given that you've tried boroda's plugin before, Instead of putting your request for scripting as a wishlist item, you should've asked for help on the plugin's thread. That plugin is the most downloaded plugin in the MB universe and boroda has been very helpful not only keeping it maintained, but helping users to get it to work as they wish (within limits.)

So I STRONGLY suggest you tone down your rhetoric and followup with plugin developers before posting wishlist requests. I also suggest that when you find something that doesn't work as you think it should, you search the forum and/or ask something in the questions section before posting bug reports.
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

boroda

  • Sr. Member
  • ****
  • Posts: 4595
This is a bit mean, @boroda
BTW, I respond better to fewer suggestions that I'm a moron.
sorry for that.

seriously, as hiccup said, 1st try to post in "questions" board before posting in "wishlist" and (especially) in "bug reports".

- what do you think ASR preset "Remove given number of characters from beginning/end of <Tag 1>" does?

I have no idea.  It's so unintuitive that I haven't been able to get it to work.

well, english is not my native language, so i'm not surprised if the preset name is confusing or unintuitive. but, no problem, i'm open to any ideas on UI/UX improvements and especially to corrections of english wordings. but it's better to discuss this on plugin's topic.

And what I *THINK* it does is suck.

isn't it a bit mean, @zlurg?

no kidding, if you have some real problems using ASR presets (or my plugin in general), just post a bug report on plugin's topic. i'm trying to support this plugin.

Until you hit the button that says Install New (preset management), none of the oiptions you mentioned are visible.  After selecting (and saving), I see those options and I will give them a try.

Perhaps those could be pre-loaded instead of no docs saying you need to load them?

there are good reasons for current implementation, they have been discussed many times on plugin topic.

recent plugin packages contain detailed instructions for updating ASR presets.

boroda

  • Sr. Member
  • ****
  • Posts: 4595
@zlurg, i've updated "Replace full date with year in <Tag 1>" ASR preset to take into account (earlier unreasonably ignored) "YYYY-MM-DD" format in addition to already supported "MM/DD/YYYY" and "DD.MM.YYYY" formats. you might want to update the plugin (of course, don't forget to update ASR presets in this case).

zlurg

  • Jr. Member
  • **
  • Posts: 42
  • A very clever text is waiting for you to decypher.
isn't it a bit mean, @zlurg?

Yes, I deserved that, guilty as charged.  I humbly apologize.  After writing that, I tried to screenshot what I was seeing and found that your instructions work fine if the options are present.  They are not present until you actually click the button.  I suggest a minor addition to the documentation.

So I apologize.

zlurg

  • Jr. Member
  • **
  • Posts: 42
  • A very clever text is waiting for you to decypher.
@zlurg, i've updated "Replace full date with year in <Tag 1>" ASR preset

Perfect.  Works great, thanks for being the bigger man.

Zak

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 2459
You can also use mp3Tag to do most if not all of the things you have asked for.
Bee excellent to each other...

Metrimer

  • Newbie
  • *
  • Posts: 1
Writing REGEXP scripts for file management and metadata fixes would undoubtedly provide library managers a great deal more freedom and power. It's fantastic that you're hoping to add comparable features to MB after being inspired by Doug's Scripts for iTunes.
You may wish to look at the idea of third-party API integration for the implementation of this. With this method, you may write scripts in the language of your choice and include them into MB such that pulldown menus and other UI components can access them.
I hope you are able to implement your proposal and provide that degree of personalization to your MB collection. It seems like a really useful software addition!
Last Edit: April 08, 2024, 08:50:59 AM by Metrimer