INTERACT FORUM

Please login or register.

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

Author Topic: New Rule Option  (Read 3277 times)

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
New Rule Option
« on: March 13, 2005, 11:07:15 am »

What Would Be Nice Is A Rule Modifyer

Path:X:\MyMusic\

Rule: ([Artist],1,1)\[Artist]\[Album]

Beatles - White Album
Would Be Saved As

x:\MyMusic\B\Beatles\White\

Bachman Turner Overdrive - Anthology (Disk 1), The
Would Be Saved As

x:\MyMusic\B\Bachman Turner Overdrive\Anthology (Disk 1), The\

It sure would clean things up in folders if this rule was avail (or something like it)
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

Wile E. One

  • Regular Member
  • World Citizen
  • ***
  • Posts: 215
Re: New Rule Option
« Reply #1 on: March 13, 2005, 12:48:16 pm »

Nice idea KS!

I would use this feature if it were available.
Logged
Now isn't this just typical of whereever this is?

drosoph

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 661
  • TiVo-aholic
Re: New Rule Option
« Reply #2 on: March 13, 2005, 10:45:49 pm »

I would use it if I could apply the same logic to sort my pictures!

Rule: ([Date],7,4)\([Date],4,3)

Would Be Saved As

Drive:\\2005\08\Files.jpg

risingdamp

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 419
Re: New Rule Option
« Reply #3 on: March 14, 2005, 06:49:05 am »

Great idea.  It could be extended to allow users to create rules that could be saved under the Rename files from properties function e.g. If artist name beings with A thru M use this path else use a different path.  That would be useful where you have to split your files over several drives.
Logged
JLee

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: New Rule Option
« Reply #4 on: March 14, 2005, 11:06:01 am »

Next MC 11 will add a function Mid(...) to the expression evaluator to let you do this.

"Rename Files From Properties..." will support expressions.

Here are samples:

Mid([Artist])\[Artist]\[Album] -> A\Abba\Gold
Mid([Artist], 0, 1)\Mid([Artist], 1, 1)\[Artist]\[Album] -> A\b\Abba\Gold
Logged
Matt Ashland, JRiver Media Center

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Re: New Rule Option
« Reply #5 on: March 14, 2005, 11:16:36 am »

oh matt

Are you married?

I love you long time

i guess with the MC version lenth = "0" really means "1"?

normaly (In visual basic at lease) the syntax is like (using your sample)

Mid([Artist], 1, 1)\Mid([Artist], 2, 1)\[Artist]\[Album] -> A\b\Abba\Gold

Quote
Returns a Variant (String) containing a specified number of characters from a string.

Syntax

Mid(string, start[, length])

The Mid function syntax has thesenamed arguments:

Part Description

string Required.String expression from which characters are returned. If string containsNull, Null is returned.
 
start Required;Long. Character position in string at which the part to be taken begins. If start is greater than the number of characters in string, Mid returns a zero-length string ("").

length Optional; Variant (Long). Number of characters to return. If omitted or if there are fewer than length characters in the text (including the character at start), all characters from the start position to the end of the string are returned.

Remarks

To determine the number of characters in string, use the Len function.

Note   Use the MidB function with byte data contained in a string, as in double-byte character set languages. Instead of specifying the number of characters, thearguments specify numbers of bytes. For sample code that uses MidB, see the second example in the example topic.
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: New Rule Option
« Reply #6 on: March 14, 2005, 11:37:50 am »

oh matt

Are you married?

I love you long time

 :-*

i guess with the MC version lenth = "0" really means "1"?

normaly (In visual basic at lease) the syntax is like (using your sample)

We were using a reversed parameter order from VB, but we may as well use the VB model.  Here's the updated doc:

Mid(...): Retrieves specified characters from a value.

Value: the value to get characters from
Start: the character to start at (optional: defaults to 0)
Characters: the number of characters to get (-1 returns all) (optional: defaults to 1)
Logged
Matt Ashland, JRiver Media Center

Wile E. One

  • Regular Member
  • World Citizen
  • ***
  • Posts: 215
Re: New Rule Option
« Reply #7 on: March 14, 2005, 12:40:47 pm »

It's small things like making a request and having it fulfilled within 2 days that reminds me why I paid my 10 dollars to upgrade to v.11.

Thanks guys  :D
Logged
Now isn't this just typical of whereever this is?

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Re: New Rule Option
« Reply #8 on: March 14, 2005, 01:07:16 pm »

Quote
We were using a reversed parameter order from VB, but we may as well use the VB model.  Here's the updated doc

it may be easyer for users to use if the VB structure was followed when dealing with strings

as for "Abba", most users would think "A" would be "1" and the second chr "b" would be "2"

and some would not know who AbbA is, but thats another story

Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: New Rule Option
« Reply #9 on: March 14, 2005, 05:13:35 pm »

Is this something that can be used to mandate saving certain parts of the alphabet to a particular hard drive or folder?
Such as: 
IF ([Artist], 1, 1)=a-j THEN Path=E:\Music1, IF ([Artist], 1, 1)=k-z, THEN Path=F:\Music2


Yes.

There's more info on if statments here:
http://www.jrmediacenter.com/DevZone/DBExpressions.htm

Take note of the IsRange(...) function.

Here's a simple sample:
Path: If(IsRange([Artist], a-m), D:, E:)\Music

This would use D:\Music for a-m artists and E:\Music for other artists.
Logged
Matt Ashland, JRiver Media Center

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20063
Re: New Rule Option
« Reply #10 on: March 14, 2005, 05:38:17 pm »

Quote
3. NEW: Added Mid(...) and IsRange(...) functions to expression evaluator.

One question

in the sample Mid([Artist], 0, 1)\Mid([Artist], 1, 1)\[Artist]\[Album] -> A\b\Abba\Gold

what happens if the first char defind in the mid$ is a "\", "/", "?" etc...

that is not compatable with drive dir naming structures?
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

Matt

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 42373
  • Shoes gone again!
Re: New Rule Option
« Reply #11 on: March 14, 2005, 05:40:42 pm »

One question

in the sample Mid([Artist], 0, 1)\Mid([Artist], 1, 1)\[Artist]\[Album] -> A\b\Abba\Gold

what happens if the first char defind in the mid$ is a "\", "/", "?" etc...

that is not compatable with drive dir naming structures?

Invalid characters get replaced by a valid character.  Underscores I think...
Logged
Matt Ashland, JRiver Media Center

risingdamp

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 419
Re: New Rule Option
« Reply #12 on: March 15, 2005, 06:22:03 am »

This is a great addition to MC.  As I'm new to MC11 this is the first time I've come across expression evaluators.  As is often the case with this sort of stuff (as marko points out) it's complicated for most of us but then appears very simple when you have a few good examples. 

So the reason for this rambling post is to ask if it's possible to have a sticky thread that lists all the difference expression evaluators that currently exist along with some examples.  This will make up for the lack of help documentation prior to official release.
Logged
JLee

risingdamp

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 419
Re: New Rule Option
« Reply #13 on: March 15, 2005, 09:14:14 am »

You're not typing the word 'path' are you?  I think he's just trying to say that the If expression goes in the box where you would normally put the path or directory name.
Logged
JLee
Pages: [1]   Go Up