Subject: Re: [Name Mangler Talk] Re: two questions - if statement with findRegularExpression as a condition? and duplicate filenames possible

From: Rob Griffiths <[email-masked]>
Date: Mon, 27 Feb 2012 06:04:03 -0800

On Feb 27, 2012, at 3:21 AM, fakob wrote:

> Much appreciated, thanks for the quick answer.
> Is it possible to have more than one command in the "else" branch?

Sure, you can put as much code there as you can logically make fit -- that's what "come up with a new name" is meant to represent. Insert your code there for building the new name, and it should work as expected. As always, test with a _copy_ of your files first, just to be sure.

regards,
-rob.

---

From: fakob <[email-masked]>
Date: Mon, 27 Feb 2012 03:21:41 -0800 (PST)

On 24 Feb., 21:38, Rob Griffiths <[email-masked]> wrote:
> On Feb 24, 2012, at 6:30 AM, fakob wrote:
>
> > 1.
> > I would like only to rename filenames which start with an underscore.
> > My approach would have been to have an if statement and put a
> > findRegularExpression as a condition. But that didn't seem to work.
> > Any idea?
>
> You can do it, with some double-negative-type checking. The following example is from Peter, our founder and programmer:
>
> [concatenate
>     [if
>         [findRegularExpression
>             "^_.*$"
>             in <name>
>             replace with ""
>         ]
>     then
>         <name>
>     else
>         "(come up with a new name)"
>     ],
>     [if
>         <extension>
>     then
>         [concatenate ".", <extension>]
>     else
>         ""
>     ]
> ]
>
> > 2.
> > If I remove special characters from my filename it sometimes happens
> > that they would have the same name. So the popup asks me to overwrite
> > or skip. Is there a way to have the renaming add for example an
> > additional number automatically?
>
> At present, that's not possible. The best you could do would be to add a sequence number to every file, to insure they're all unique. Barring that, you'll have to manually identify the would-be duplicates first.
>
> regards,
> -rob.

---

From: Rob Griffiths <[email-masked]>
Date: Fri, 24 Feb 2012 12:38:58 -0800

[concatenate
    [if
        [findRegularExpression
            "^_.*$"
            in <name>
            replace with ""
        ]
    then
        <name>
    else

regards,
-rob.

---

From: fakob <[email-masked]>
Date: Fri, 24 Feb 2012 06:30:12 -0800 (PST)

Hi there

I have two questions: maybe there is somebody who can help me.
1.

I hope that I made myself clear :-)

Thanks in advance

fakob