INTERACT FORUM

Please login or register.

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

Author Topic: Top 20 Scripting Tasks  (Read 3783 times)

gvanbrunt

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1232
  • MC Nerd
Top 20 Scripting Tasks
« on: April 13, 2012, 08:36:01 am »

I would like to put together a list of 20 scripting tasks. For example "Add a song to playlist". After having collected the list, I would like to update the Wiki documentation to include examples of doing it various languages. I think many could benefit from that knowledge.

So the question is, what are you using scripting for currently? Also, what would you like to be able to automate? These can be using any of the available methods/API's.
Logged

nwboater

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1346
Re: Top 20 Scripting Tasks
« Reply #1 on: April 13, 2012, 11:44:18 am »

In this thread  http://yabb.jriver.com/interact/index.php?topic=67579.msg453588#msg453588  JustinChase has very graciously shared his method of marking TV recordings with edl files so that Comskip can work in MC and WMC. He has just written a simpler procedure that just works in MC. He uses the external program MC-TVConverter 2.1.0 to do the required tasks. I'm wondering if this could also be accomplished with Scripting and if it might even be easier yet to implement?

Thanks,
Rod
Logged

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3276
  • Getting older every day
Re: Top 20 Scripting Tasks
« Reply #2 on: April 13, 2012, 12:37:27 pm »

This may not be exactly what you're looking for, sorry if so.

I don't currently do any scripting (don't know how), but I would like a script to use the Series name and Episode name to look up the Season and Episode Numbers.  Neither JRiver nor WMC includes season or episode number in the metadata, but does include Series and Episode Names and Original Air Date.  I don't know of any way currently to auto-populate the Season and Episode Numbers, and am very tired of doing it manually.
Logged
pretend this is something funny

Vincent Kars

  • Citizen of the Universe
  • *****
  • Posts: 1154
Re: Top 20 Scripting Tasks
« Reply #3 on: April 13, 2012, 02:39:51 pm »

As far as I know, MC doesn’t support scripting. You can’t do something like
A=[Song]
B=[Composer]
C=A || B

You can only use expressions.
Unfortunately you can have only 1 compound expression.
This makes them hard to build and to debug like

If(IsEmpty(ListItem(FixCase([Album],4),1,d.)),
If(IsEmpty(ListItem(FixCase([Album],4),1,bwv)),
If(IsEmpty(ListItem(FixCase([Album],4),1,op.)),
If(IsEmpty(ListItem(FixCase([Album],4),1,woo)),
If(IsEmpty(ListItem(FixCase([Album],4),1,kv)),
,
KV ListItem(FixCase([Album],4),1,kv)
),
WoO ListItem(FixCase([Album],4),1,woo)
),
Op. ListItem(ListItem(Replace(Replace(FixCase([Album],4),/(,;),-,;),1,op.),0)
),
BWV ListItem(FixCase([Album],4),1,bwv)
),
D. ListItem(ListItem(Replace(Replace(FixCase([Album],4),/(,;),/,,;),1,d.),0)
)

You can’t have multiple lines like


Asking for a scripting language is probably a bit too much.
But multiple independent expressions MP3Tag style would be a great asset.
Makes using them much easier.

I use scripts to clean up my tags as shown in the examples below
http://thewelltemperedcomputer.com/SW/Players/MC14/MC_Expression_opus.htm
http://thewelltemperedcomputer.com/SW/Players/MC14/MC_Tagging.htm
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Top 20 Scripting Tasks
« Reply #4 on: April 13, 2012, 03:34:24 pm »

Vincent, I agree.

But until then, you're working too hard.  Try something like this:

Regex([Album], /#(Op\.|BWV) ?([^(]+)#/, -1)/
   if(isequal([R1], op., 1), FixCase([R1],2),[R1]) [R2]

I only tested w/the samples shown in the screenie.  Provide me with some more, and I'll work those in too.
Logged
The opinions I express represent my own folly.

nwboater

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1346
Re: Top 20 Scripting Tasks
« Reply #5 on: April 13, 2012, 04:36:03 pm »

As far as I know, MC doesn’t support scripting......
 
Asking for a scripting language is probably a bit too much......


My take on the original post was that he was not expecting that the scripts had to be done within MC. Or did I misunderstand?

Rod
Logged

Vincent Kars

  • Citizen of the Universe
  • *****
  • Posts: 1154
Re: Top 20 Scripting Tasks
« Reply #6 on: April 13, 2012, 04:40:19 pm »

Regex([Album], /#(Op\.|BWV) ?([^(]+)#/, -1)/
   if(isequal([R1], op., 1), FixCase([R1],2),[R1]) [R2]
MrC

I see some very beautiful music in the screen.png
And some horrible syntax

Fortunately at the time I wrote that expression there was no regex in MC.
Today there is but I’m afraid I will never grasp it.
But I know, if I need some help you will come to my rescue
Thanks.
Logged

MrC

  • Citizen of the Universe
  • *****
  • Posts: 10462
  • Your life is short. Give me your money.
Re: Top 20 Scripting Tasks
« Reply #7 on: April 13, 2012, 04:43:43 pm »

It's like your lips are moving, but you're not saying anything:

And some horrible syntax

because my eyes read...

Quote from: Vincent Kars
....
),
Op. ListItem(ListItem(Replace(Replace(FixCase([Album],4),/(,;),-,;),1,op.),0)
),
BWV ListItem(FixCase([Album],4),1,bwv)
),
D. ListItem(ListItem(Replace(Replace(FixCase([Album],4),/(,;),/,,;),1,d.),0)

 ;D
Logged
The opinions I express represent my own folly.

gvanbrunt

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 1232
  • MC Nerd
Re: Top 20 Scripting Tasks
« Reply #8 on: April 16, 2012, 10:58:46 am »

Quote
My take on the original post was that he was not expecting that the scripts had to be done within MC. Or did I misunderstand?

You are correct. MC supports a few different methods of automating. These are are done "outside of MC". But they can control, update the database, etc. They are also commonly used in Theater View to get functionality not normally possible there. In that case they are usually one line MCC commands. Even so, they are technically scripting.

As for scripting "inside" MC, that is also possible with some plug ins...

What I'm looking for is anyone that is using scripting or MCC commands to automate MC already so I can come up with a list of common tasks that people do. Or even some "stupid MC tricks" would be good. Many Theater View "hacks" would fit under that category.

Quote
I would like a script to use the Series name and Episode name to look up the Season and Episode Numbers
I thought it did do this, but I could be wrong. If not that would be an excellent idea for polishing which JRiver is currently focusing on in MC17. You might want to start a new thread about that...
Logged
Pages: [1]   Go Up