1 (edited by Borut 2012-04-29 22:12:25)

Topic: %e at the beginning of an absolute path

When using 3.00 beta 2 build 888, then...

This works as expected:

P:\\=%e=Photo\\_Photo\\%dm{"%Y"}\\%dm{"%Y%m"}\\%dm{"%Y_%m%d_"}\\%dm{"%Y-%m-%d_%H%M%S"}%T{"C:\\_PortableProgramFiles\\siren\\abcd.txt",%nc{1,0}}.%e;%fc[1,1,"="]%fc[3,1,"="]

But this does not:

%e=P:\\Photo\\_Photo\\%dm{"%Y"}\\%dm{"%Y%m"}\\%dm{"%Y_%m%d_"}\\%dm{"%Y-%m-%d_%H%M%S"}%T{"C:\\_PortableProgramFiles\\siren\\abcd.txt",%nc{1,0}}.%e;%fc[2,1,"="]

Maybe I am making an error and maybe it is a bug.


BTW, in on line help > Examples, there are two same titles "Rename associated files while renumbering them" at the beginning of the page.

Regards,
Borut

Re: %e at the beginning of an absolute path

Borut wrote:

But this does not:

%e=P:\\Photo\\_Photo\\

An leading %e before the drive letter makes no sense.
What path would that be?

%e=P:\\Photo\\_Photo\\
JPG=P:\Photo\_Photo\


I only can imagine smtg like:
P:\\%e=\\Photo\\_Photo\\
P:\JPG=\Photo\_Photo\

Re: %e at the beginning of an absolute path

Stefan wrote:

An leading %e before the drive letter makes no sense.

Hi Stefan, The-XY-scripting-guru. It is nice that we have similar things on our radars! tongue

Well, it does seem to make sense: As an intermediate result for the next expression.

When one wants that the collision logic takes also the extension into account, then (due to somewhat problematic conceipt of Siren scripting, I would say) one has to go that way.

See in Help: Examples > "Rename associated files while renumbering them"

Have a nice First of May!

Regards,
Borut

4 (edited by Stefan 2012-04-30 14:28:23)

Re: %e at the beginning of an absolute path

Ahh, i see. Thanks for the link:

Help: Examples > "Rename associated files while renumbering them"

How does it work ?
An rename expression can be compound of "sub-expressions" separated by ';' (semicolon).
They are evaluated one after another on all the files.

Of course, from the second one all the variables normally associated to the "Current name" (%f, %e, %N ...)
will be related to the "New name" computed by the previous one.

Why adding "%e" at the beginning of the name and remove it just after ?

"%nc" gives a number avoiding collisions without taking into account the following rest of the expression.
In our example the extension has to be part of the collision evaluation.
By creating a temporary one, we will get the expected result.


----

BTW to all, if someone is interested.

Borut wrote:
P:\\=%e=Photo\\_Photo\\

Explanation:
Since the "\"-sign is taken as an meta char  in Siren, we have to escape them by doubling them like "\\".

For your convenience there is an short cut to double the back slashes:

Help > User interface tips > Expression combo shortcuts
  Ctrl+Shift+B doubles the '\' (backslash) present in the selected text

But this works only for selected parts. This bit is overseen often.


Side note, forward slashes "/" will work as path delimiter (like "\") for Windows too and so also in Siren.

Re: %e at the beginning of an absolute path

The problem is the volume separator (":").
A "simple" solution can be (another trick wink) to substitute and then replace it. With a "@" for example:
%e=P@\\Photo\\_Photo\\%dm{"%Y"}\\%dm{"%Y%m"}\\%dm{"%Y_%m%d_"}\\%dm{"%Y-%m-%d_%H%M%S"}%T{"C:\\sr_dta.txt",%nc{1,0}}.%e;%fc[2,1,"="]("@",":")

Regards,

Remi

Re: %e at the beginning of an absolute path

Thank you for the explanation!