How do I get it to add 2 "blank characters" before single digit numbers. I tried using Alt+0160 twice for 2 blank characters but it doesn't seem to add them when actually pasting the tags to the place I
AFAIK filenames with leading space characters are invalid. That is why they get cut away with $validate(). But as leading 0 are valid characters anyway, I wonder what $validate() should do in this case.
I hadn't realized that leading blanks - rather than zeros - were actually intended to be inserted; hence my previous response.
To prevent standard spaces (0x20) from appearing at the beginning or end of a filename in the first place, there is no need for $validate(), as the operating system itself prevents this.
This Microsoft article also points to other whitespace characters that might potentially be used to achieve the goal; however, I would strongly advise against pursuing such unconventional approaches.
I accidently hit enter or something while typing my original post and I had no way of editing it because it went straight to pending approval sorry!
This is being used for the copy tags to text feature so that I can copy and paste an albums information to another forum. I am trying to add 2 leading spaces (using blank characters from the character map) before single digit numbers because that is what is needed to make the information align how I want when posting to the forum. I was also trying to use the Alt+ whatever for the blank character instead of just using spaces as when I manually type the information into the other forum it deletes the leading spaces but using the "blank character" the forum doesn't delete those when posting. I am not at home now to show you how it looks, but I am not using any of this to change tags or file names its just for posting the tag information. It may not be possible but hopefully you understand what I am trying to do now.
In that case do not use $validate() as that removes the leading spaces even if they were there.
If you have special characters to add then you could use $char() or even $repeat($char(),x) to insert them as leading characters.
See more scripting functions in the documentation:
When I get home hopefully I can figure out the exact string to remove the 0 from single digit numbers and replace with a character but would char string then be $repeat($char(0160),2) because Alt+0160 is what I remember it saying on the Windows character map.
$num(%track%,1,$repeat($char(0160),2) is it something like this?
Yes the spaces should be in front of the single digit numbers.
Google tells me the decimal code for "No-Break Space" is 160 which is just the blank char I was using 2 of to get it to align how I wanted, does this sound right?
It's adding the spaces in front of the double digit numbers like 10, 11, 12 also. Not a big deal as I don't think the forum for some reason is accepting the chars as anything other than spaces, even though if I manually put the chars in it uses them. Any
Edit: actually it would work if I could get it to not put the spaces in front of 2 digit numbers! Any ideas?
Using this code: ♫ $repeat($char(160),$sub(4,$len($num(%track%),1)))$num(%track%,1) %artist% %title% $regexp(%_length%,^0(\d:),$1)
Makes the top version of this screenshot.
Manually deleting (2 back spaces) the 2 break spaces from Tracks 10-14 produces the bottom version of the screenshot, which is what I am trying to achieve.