INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: small tool to get tags to clipboard  (Read 3125 times)

gappie

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 4566
small tool to get tags to clipboard
« on: April 28, 2014, 02:49:51 am »

ive been trying to find a way to get some tags to the clipboard. http://yabb.jriver.com/interact/index.php?topic=88888.msg609841#msg609841
so i made a small tool myself. maybe someone else finds it handy. so i post it here. 8)

this is how it works. download the zip from here: http://www.gappie.nl/DL/CtoCforMC.zip
in the zip you find a exe file. place that somewhere on your machine.
in MC rightclick on a file and go to Send to>send to (external), and add a program.
Give it a name and link it to the exe file.

for the paramaters: the exe file can handle up to 10 parameters where a parameter is what is between quotes. so "[name] - [album]" is one parameter, "[name]" "[album]" are two parameters (notice the space between the two!). each parameter will be on a new line in the clipboard.

example:
"[name] by [artist] from [album]" gives

Invocation by Matana Roberts from Coin Coin Chapter Two: Mississippi Moonchile

"[name]" "by" "[artist]" "from" "[album]" gives

Invocation
by
Matana Roberts
from
Coin Coin Chapter Two: Mississippi Moonchile

Disclaimer: Downloading and using this file is at your own risk!!!

 :)
gab



Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 71539
  • Where did I put my teeth?
Re: small tool to get tags to clipboard
« Reply #1 on: April 28, 2014, 06:41:45 am »

gab,
I'm not sure what you're using it for, but MC can copy and paste tags.

Select a file
Ctrl-C
Select a new file
Ctrl-Shift-V will paste tags of your choice from the first file to the second.
Logged

gappie

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 4566
Re: small tool to get tags to clipboard
« Reply #2 on: April 28, 2014, 07:01:20 am »

gab,
I'm not sure what you're using it for, but MC can copy and paste tags.

Select a file
Ctrl-C
Select a new file
Ctrl-Shift-V will paste tags of your choice from the first file to the second.
wow Jim.. I didn't know about Ctrl-Shift-V. that is nice and handy.

But that is not what this is for. its for getting tags to other programs for instance some information about an image you are mailing.

 :)
gab
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: small tool to get tags to clipboard
« Reply #3 on: April 28, 2014, 02:59:37 pm »

@gappie - Passing your parameters on the command line that way in Windows will likely break once a tag contains a double quote.  The quoting rules for Windows command line are... well... simply terrible and broken by (mis-)design.

To do this robustly, you need to either read the tags yourself via MCWS (or COM), or pull the clipboard contents and parse the CSV data.

@JimH - I think gappie wanted to construct a pre-filled email message (or other) from tags, via Send To (or Links, but these won't work because Links don't support the mailto: URIs).
Logged
The opinions I express represent my own folly.

gappie

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 4566
Re: small tool to get tags to clipboard
« Reply #4 on: April 28, 2014, 04:46:54 pm »

im sorry I shared this... my mistake.. works for me though, very nicely actualy. thought somebody else might find it helpful..

 :-[
gab

please delete it

Logged

gappie

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 4566
Re: small tool to get tags to clipboard
« Reply #5 on: April 28, 2014, 04:55:01 pm »

and mrc  no that is not what I am after...
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: small tool to get tags to clipboard
« Reply #6 on: April 28, 2014, 04:56:45 pm »

OK, my mistake.
Logged
The opinions I express represent my own folly.

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608
Re: small tool to get tags to clipboard
« Reply #7 on: April 29, 2014, 12:44:33 am »

@gappie - Passing your parameters on the command line that way in Windows will likely break once a tag contains a double quote.  The quoting rules for Windows command line are... well... simply terrible and broken by (mis-)design.

To do this robustly, you need to either read the tags yourself via MCWS (or COM), or pull the clipboard contents and parse the CSV data.

I could probably whip up said utility without much trouble at all.  I already have the parsing code so that MCAutoQueue can do this task.  So, I'd just need to point that stuff at the clipboard and take the parameters.

What are your requirements for the output?
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

gappie

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 4566
Re: small tool to get tags to clipboard
« Reply #8 on: April 29, 2014, 01:31:20 am »

@gappie - Passing your parameters on the command line that way in Windows will likely break once a tag contains a double quote.  The quoting rules for Windows command line are... well... simply terrible and broken by (mis-)design.

To do this robustly, you need to either read the tags yourself via MCWS (or COM), or pull the clipboard contents and parse the CSV data.
well actually I just tried it.. when there are 2 double quotes in a tag they will just disappear. wont call that breaking. when there is one of them the new line rhythm changes.. but it did not really break. its just a tool to get some info nice and easy to the clipboard.
@JimH - I think gappie wanted to construct a pre-filled email message (or other) from tags, via Send To (or Links, but these won't work because Links don't support the mailto: URIs).
in the thread I linked to above, I tried to get mc to open an new email via an adres that is stored in the tags. sending a parameter like "mailto:[name] <[email]>" to the thunderbird exe works.

 :)
gab
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: small tool to get tags to clipboard
« Reply #9 on: April 29, 2014, 01:48:25 am »

Ok, sounds like it works already well enough for you.

If you need something more robust, and something more extensible, I'll also offer to write you up a scriptlet for pscriptor.  It can post data back to the clipboard however you want, or call you final program directly.
Logged
The opinions I express represent my own folly.

gappie

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 4566
Re: small tool to get tags to clipboard
« Reply #10 on: April 29, 2014, 02:11:16 am »

Ok, sounds like it works already well enough for you.

If you need something more robust, and something more extensible, I'll also offer to write you up a scriptlet for pscriptor.  It can post data back to the clipboard however you want, or call you final program directly.
thank you for the offer. but it just works well enough for me.. out of curiosity, I just wanted to have something like right click on a record or thumb to copy things to the clipboard, and that works. with pscriptor I would accomplish that by sending it to a list?
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: small tool to get tags to clipboard
« Reply #11 on: April 29, 2014, 12:07:39 pm »

... out of curiosity, I just wanted to have something like right click on a record or thumb to copy things to the clipboard, and that works. with pscriptor I would accomplish that by sending it to a list?

Since it seems like you are using your tool by selecting a single record, and then doing a Send To, you'd do the same thing.  Your Send To > External Command would be defined to call pscriptor, and the scriptlet could do almost anything you want.  It could, for example, place formatted track tags on the clipboard, in pretty much any format that you need, so that you can just paste your final result, or it could construct an email message from the tags, or whatever.

The pscriptor program is a driver program that does all of the common work required to work with MC; it has access to MC's selected track(s), and immediately to the tag data in the view.  It makes this data available to simple one-liner command line script code, or to scriptlets (which are small amounts of code in a file), calling the scriptlet for pre-processing work, per-file work where returned tag values will be automatically updated by pscriptor, and for any desired final post-processing work.  The scriptlet can perform other actions like creating playlists, getting cover art sizes, extracting embedded cover art, etc.  There are some example scriptlets that I've included in the release:

   http://yabb.jriver.com/interact/index.php?topic=85990.0
Logged
The opinions I express represent my own folly.
Pages: [1]   Go Up