[X] Scripting Bug in FTF Conversion?


#1

The following seems to always return NULL in Filename to Filename Conversion:

$char($upper($left(%3,1)))

#2

What does $upper($left(%3,1)) return?


#3

My Old Filename pattern is:

%1 (%2) %3 [%4{%5}] %6 ~ %7

Where %3 is the album artist. So if the artist is ohGr, $upper($left(%3,1)) returns O (uppercase letter O). I've tested this and it works fine. I just wanted to add another if check, so if the artist is 808 State, it would end up in a folder called #. I wanted to do it by checking the ASCII number, but it doesn't seem to return a number.
EDIT:
Here's the New Filename patern I was trying:
$if($and($geql($char($upper($left(%3,1))),65),$leql($char($upper($left(%3,1))),90)),$left(%3,1),"#")\%3\%2 ~ %4\%5 ~ $if($eql(%3,%6),%7,%7 '['%6']')


#4

$char() converts numbers (0-255) to ASCII and not characters to their ASCII-Code number.


#5

Ouch...that would explain it then. This could be another thread marked with a [X]. Florian, do you think you could write a reciprocal function to char$()?


#6

Yes, I'll try to add a reciprocal function to the next release.


#7

Thank you :w00t:


#8

beaker,

is a function which tests if a character represents a decimal number of any help for you?

Example (not yet implemented): $if($isdigit($left(%artist%,1)),is a digit,is not a digit)


#9

Yes, that would be great. :slight_smile: It would cut down on the filename pattern I was trying to use. Thanks, florian.


#10

I just returned from vacation and got a chance to test the new version. Works great. My revised New Filename pattern is:

$if($isdigit($left(%3,1)),"#",$upper($left(%3,1)))\\%3\\%2 ~ %4\\%5 ~ $if($eql(%3,%6),%7,%7 '['%6']')

Thanks again, florian.


#11

Glad that it solved your problem :slight_smile:

Best regards,
~ Florian