I see that we have the option to copy file names (for example with Clipboard COPYNAMES=nopaths). Is there an easy way to copy the metadata of a music file? In particular the track length?
I know similar questions have been asked before, but no real example as been provided and I would love some clarification if possible.
This will copy mp3songlength of all selected files into the clipboard. Values will be in seconds.
function OnClick(clickData) {
var tab = clickData.func.sourcetab;
var result = '';
for (var e = new Enumerator(tab.selected_files); !e.atEnd(); e.moveNext()) {
var item = e.item();
var tmp = item.metadata.audio.mp3songlength;
if (typeof tmp == 'undefined') continue;
result += tmp + '\n';
}
if (result == '') return;
DOpus.SetClip(result);
}
What is the actual command to do that ? Because this shortkey is assigned to another action on my setup.
Plus, I have a script (made by you by the way) that display the shell product version. It can be accessed in tooltip by {scp:Shell Product Version/ShellProductVersion}. But how I get this value from a script ? I can not do better than item.metadata.exe.prodversion.
There isn't a command to copy the tooltip text to the clipboard. It's something that's hardcoded to Ctrl + Shift + C.
FSUtil.GetShellProperty or Item.ShellProp can be used to get shell property values within scripts. (Please start a new thread if you need more help with that.)
When I use this shortkey while the tooltip is displayed, it still applies the action assigned to it. In my case Clipboard COPYNAMES=unc. It’s not a big deal because I never intended to copy the tooltip before knowing this tip but it’s worth being mentioned.
Perfect. item.ShellProp("System.Software.ProductVersion"); work as intended.
We'll add Clipboard COPYINFOTIP to do this in 12.25.1 beta (note: not 12.25, but the beta after it).
I also noticed that you can use Ctrl+Shift+Alt+C to trigger it at the moment. It's a bit of a pain to type, but serves as a temporary workaround.
We also have a couple of other small improvements to how this works, but I'll leave this for the eventual release notes in case the details change between now and then. Nothing too exciting though.