For tasks like this, there is the (free, open-source) program AutoHotkey.
Wow thanks very much ojdo, like AldiMp3, I was looking in the foobar2000 shortcut preferences with no luck. I’m also an AHK great fan and user but I did not think of it for this problem ! Maybe because I’m used to a very configurable foobar2000, I’m not used to need external soft for it.
Here I share my AHK setup (I don’t use clipboard, I use Other…), it’s a special formatting I like that may not suit you but you can change it with foobar2000 syntax.
It does these things to ARTIST, TITLE and ALBUM (and ALBUM ARTIST*) :
; ######################################
; FOOBAR2000 : AUTOMATICALLY FILL VALUES
; ######################################
#ifwinactive ahk_exe foobar2000.exe
^y::
sendinput !{enter}; warning, must select some files first
winwait, Properties
ifwinnotactive, Properties, winactivate, Properties
winwaitactive, Properties
sendinput !tf
winwait, Automatically Fill Values
ifwinnotactive, Automatically Fill Values, , winactivate, Automatically Fill Values
winwaitactive, Automatically Fill Values
sendinput o{tab}
sendinput % "$replace($replace($upper(%artist% :: %album% :: %title% [:: $meta(album artist)]),'',’),...,…)"
sendinput {tab 2}
sendinput % "%artist% :: %album% :: %title% :: %album artist% "
sendinput !o
return
(*) Incidentally adds album artist even on non various-artists albums (VAA) :/ (quite dumb but I didn’t want to have both a VAA pattern shortcut and a non-VAA pattern shortcut, so I delete the album artist tag manually after shortcut, maybe there is better way I didn’t find yet).
edit : fixed using $meta(album artist) instead of %album artist% (very frequent fix).
What I added compared with your great help is :
- Only triggers in foobar2000 (but same known problem : I don’t check if there is selected lines in fb2k first as it would require difficult code with ControlGet that I have no clue about)
- Waits for specific windows instead of relying on sleep timers
- Using sendinput is both faster and safer than send
So if someone can help me with my ALBUM ARTIST problem and test if selected problem, you’re very welcome.