Modification of Variables

Hi there,

is there a way to modifiy variables created with the @set modifier?
It would be really powerfull to have a way to use RegEx on user variables
also an additional modifier to extend a variable like @set uservar += "content to add"
or an modifier @setadd...

But mostly i'm in need of a RegEx function for variables. May we can see something like this in a future version.
by the way... great work in dopus 10... many new exciting features!

cheerz!

I don't think it's possible at the moment, at least not in general.

What sort of thing are you aiming to do where you need to modify a regex in a variable?

Hi,

actually I would like to use the SetAttr META command to tag mp3files.
90% of all metatags i can get from the filepath by using RegEx.

@nofilenamequoting
Clipboard COPYNAMES=single REGEXP "(.)\(.)\(.).[^.]+" "\2" "(.)_(.)#" "\1 \2" "(.) - (.) ((.))-([0-9]+)" "\2"
SetAttr META "title:{clip}"

This will work fine as long the title does not include any spaces. If spaces are found the RegEx result will be set in
quotation marks. this will cause the SetAttr META to fail.

Great would be if there where a RegEx command and I could use something like this

@Set test = {filepath$|..|noterm}
RegEx {text to parse} {pattern} {replace}

Or alternate a possibility to use RegEx when set a modifier like
@Set test = {filepath$|..|noterm} {pattern} {replace}

I hope will explain more what I mean...
Thnx...

You can give the Clipboard COPYNAMES command as many regexp pairs as you want. Each one will be applied in turn (with non-matching ones being skipped).

So you could just add an extra pair after your main pair which removes the quotes.

(At least, I think that's how it works. It's a while since I last used it.)

As you see I already give multi RegExp pairs to the Clipboard COPYNAMES command

@nofilenamequoting
Clipboard COPYNAMES=single REGEXP "(.)\(.)\(.).[^.]+" "\2" "(.)_(.)#" "\1 \2" "(.) - (.) ((.))-([0-9]+)" "\2"
SetAttr META "title:{clip}"

but i could not get it work to remove the quotas, seems the Clipboard command always put spaced text in quotas and i remember that i have read something like this in the manual...

Ah, you are right of course. I forgot about that.

I didn't realise there was multiple regexps there; I keeps seeing it as one huge pair. :slight_smile:

There might be some way to get this approach to work but I think I would use VBScript or something instead. Then it's much easier to simply pass the script the names/paths and let it do whatever it wants to them, then have it tell Opus to set the metadata.

You can use things like dopusrt.exe /cmd SetAttr FILE="xyz" META "title:abc" to tell Opus to run a command from an external script/program.

I'm working already on something like that.
But would be really fine and useful to see a RegEx Command in a future version.
The building of commands will become much more powerfull.

Thanx for help...