Page 1 of 1

Special characters in replacement matrix

Posted: Thu Jul 31, 2014 10:16 pm
by Wronschien
Hello, I've been using TGF for a few years now, and I'm a bit struggling with the new formatting options.
Specifically I've got a problem with the replacement matrix. When I set a character (or word) to match and replace, it generally works, except for the two ones I'd really like to replace !
That is ':' and '/'. The new version just doesn't find them although they really occur in the tag fields.
This used to work like a charm in the previous version (0.72 I think, it was on my older PC).
Is there a new mechanism I haven't understood ?

Re: Special characters in replacement matrix

Posted: Fri Aug 01, 2014 4:23 pm
by jtclipper
Please make sure that in your workflow you have a task with a matrix,
in the lower part of the screen select your created matrix in the 'task parameters' and in the 'apply to' list check the fields you want to format.

Re: Special characters in replacement matrix

Posted: Fri Aug 01, 2014 9:58 pm
by Wronschien
Well that's what I'm doing and this works for any word I've tried… but not for these two characters !
Thanks for the reply though

Re: Special characters in replacement matrix

Posted: Sat Aug 02, 2014 12:26 pm
by jtclipper
Can you send me your tgf.ini file so I can reproduce if possible?
Also what Windows version are you using

Re: Special characters in replacement matrix

Posted: Sat Aug 02, 2014 2:57 pm
by Wronschien
Alright, here it is.
I'm running Windows 7 64bit.

(And btw, it really hates when I hit the "Alt Gr" key, an error window pops "Access violation as address 00000000. Read of address 00000000." But this is not that much trouble)

Re: Special characters in replacement matrix

Posted: Sat Aug 02, 2014 3:44 pm
by jtclipper
In your workflow you need to select the fields you would like to update, only filename is selected in the matrix task (the default), check all the tag fields that you are using

Re: Special characters in replacement matrix

Posted: Sat Aug 02, 2014 5:50 pm
by Wronschien
I did that, actually the filename is the only one to be changed in that case (and that's precisely because / and : are not allowed in filenames that I want them replaced).
But the settings are right anyway, because if I change the character '/' in the matrix to any word (that appears in the files of course) and make no other change then the filename is modified accordingly.

Re: Special characters in replacement matrix

Posted: Sat Aug 02, 2014 8:03 pm
by hopalongrock
Maybe the Options - Edit - Rename - Illegal characters - Remove/Replace action happens before the Workflow & Replacement matrix action on filename. It isn't possible to disable the illegal character rename.

Re: Special characters in replacement matrix

Posted: Sat Aug 02, 2014 8:25 pm
by Wronschien
hopalongrock wrote:Maybe the Options - Edit - Rename - Illegal characters - Remove/Replace action happens before the Workflow & Replacement matrix action on filename. It isn't possible to disable the illegal character rename.
Exactly ! Now it works indeed, thank you for this answer.
It would be better if we could disable this behaviour or set specific replacements for individual illegal characters but still. Maybe have the possibility to apply the matrix before the automatic removal?
At least I understand what's happening and this can be worked around now.

Re: Special characters in replacement matrix

Posted: Sun Aug 03, 2014 3:48 pm
by jtclipper
In that case you can use variable scripts to override the illegal character replacement.

You need to go to options/formatting/variables and in the user tab click 'manage..' in the script section and paste this code

Code: Select all

begin
  var_result( AnsiReplaceText( gTag.Artist, ':', ' --' ) );
end.
Save the file (for example) as art.scv

Now in the filename format string I see you use something like %A% - %Y% - %L% - %R% - %T% replace with %@art.scv% - %Y% - %L% - %R% - %T%, as you can see the artist variable is now using the script above.

So when the filename is constructed it will receive a formatted string that replaces ':' with ' --' as you have set in your matrix.
You must alter the default matrix though because it replaces '--' with ''

Following the above example you can do the same with %L% and %T%.

Now you only need to take care of the '/' character so in the illegal rename character option set 'replace with..' to '-'

Re: Special characters in replacement matrix

Posted: Sun Aug 03, 2014 4:13 pm
by Wronschien
Ah yes this is a good idea thank you !

And many thanks for this very nice piece of software of course.

Re: Special characters in replacement matrix

Posted: Sun Aug 03, 2014 4:40 pm
by jtclipper
I had a look at the new code and there is actually a glitch with illegal chars and the workflow.
Your original matrix should work in the first place, will try and sort this out in the next beta to make the behavior more straightforward.

Re: Special characters in replacement matrix

Posted: Sun Aug 03, 2014 5:20 pm
by Wronschien
Ah good !
Then my little problem will have been useful somehow.