Replace %20 button crashes DOpus

[quote="jon"]I can't repeat this here - it seems to work fine. Is it repeatable consistently? Does it only happen on certain filenames, etc?
[/quote]
Happens anywhere with anything that would allow that button to work.

Will error report.

There's definitely a problem here. I get the same result as Steje. Until there's a fix, this works for me - not as convenient though.

rename pattern "{dlgstring}" to " " findrep

You can enter %20 into the dialog and it replaces with a space succesfully. It fails though if you edit the command to have %20 instead of {dlgstring}.

Another workaround is to use two % instead of one:

@NoDeselect Rename PATTERN="%%20" TO=" " FINDREP
I'm guessing the problem stems from the %2 being interpreted like the %1 code (Explorer's syntax for inserting the selected file path) when used in a context menu. Using %% seems to 'escape' the % so that it produces just a literal %.

[quote="leo"]Another workaround is to use two % instead of one:

@NoDeselect Rename PATTERN="%%20" TO=" " FINDREP
I'm guessing the problem stems from the %2 being interpreted like the %1 code (Explorer's syntax for inserting the selected file path) when used in a context menu. Using %% seems to 'escape' the % so that it produces just a literal %.[/quote]

It works in a toolbar, as opposed to context, button. But not in my "files" context menu. That still crashes DOpus.

I did wonder about some prefix that would make it 'literal' but had not tried anything. (I wondered if borrowing from regex would work, but I chose the simple route because regex frightens me.)

Thanks for the help everyone, Funny that jon can't repeat it.

FWIW, it worked in the All Files context menu for me. (No crash, no ill behaviour once the extra % was added.)

Hopefully looking at why it misbehaves will also reveal why it's crashing for you.

I have just tried it on another machine, same result.

Kaboom.

Also "All files" context menu.

In the learning process, I tried it in the context menu for the "Documents" group. Same crash.

Just added my Opus / Windows version info to my signature - in case that has anythin to do with the differing results we're all seeing.

Also, this is probably only of 'anecdotal' value - but borrowing from Steve's suggestion of an alternative... THIS also worked for me (from the 'All files' context menu):

@nodeselect @set var = "%20" Rename PATTERN "{dlgstringS|Specify Replacement String|{$var}}" TO " " FINDREP

[quote="michaelkenward"]I have just tried it on another machine, same result.

Kaboom.
[..]
Same crash.[/quote]

Well, if you are getting a real crash then you need to send us the crash reports please to give us something concrete to trace. It's not reproducible here.

OK. I have a crash report. What do I do with it?

The message at the end of the link you offered does not tell me. (You might like to expand on that bald statement.) Nor does the form I have to fill in to report a problem.

Maybe that comes at the next stage.

Errr ... You can attach the report to an email ...

Aha. Progress.

The problem is in the name you give to the button.

If you use the %20 as the button's text, to show you what the thing is supposed to do, DOpus crashes. So the problem is not in the script engine, or whatever does the renaming.

I haven't tried it, but I'd guess that putting % in the label for anything might crash DOpus.

After Steje's helpful suggestion also crashed the thing, the third option kindly offered here and one that clearly worked for him, I decided that there must be something really strange happening.

So, I changed the label to eliminate the %. (I had used "Replace %20" as the label.) No crash.

As to sending the crash file by email, that is not how the support system is set up. I decided to follow the instructions that the average punter, rather than a member of the inner circle, would use.

In the event, I attached the dump in a response to the email the robot sent to acknowledge my submission via the web form. Quite why that form does not allow people to attach dumps is a mystery to me. But I guess they have their reasons.

There is no Inner Circle, there is no Conspiracy. It's just common sense that if someone from GPSoftware asks you to send a crash dump then the method used is left as an exercise for the user. It's not rocket science.

But he didn't tell me how to send the dump. The link just told me how to find it.

I don't like pestering people with messages that they don't want to receive. Nor do I want to break their support systems. (Actually, I have broken the system by attaching the file to a reply from them.) So I went down the route laid down by DOpus.

I mentioned this here because it seems to me that the message telling people how to find a crash dump just might use a slight tweak to explain things a bit better, especially for dimwits like me.

A clearer explanation might avoid stupid messages like this one.

I put a note at the bottom of the FAQ.

Many thanks. Anything to ease the process ....

Good work tracing it down to the "%" character in the menu item 'name'. Reproduced, and I've sent MY crash dump to GPSoft as well...

I also think I'll submit a separate bug report on the behavior of the actual rename command you wanted to run - which I find kind of amusing that we now seem to have determined actually has NOTHING to do with the crash you're experiencing... but which revealed there is some 'other' problem with the way that Rename command is working from the context menu as opposed to toolbar.

I also found some other strange behavior while testing out my last suggestion to you to get the command working based on Steve's suggestion with a little less typing... It seems there is some other weirdness with certain uses of Clipboard SET in {dlgstring} dialogs used in the rename command as well... I originally tried to use THAT instead of @set variables...

Ah - it feels good to be putzing around with Opus forum issues again :wink:.

It is a pity I didn't twig the real cause earlier, but then again we might not have found these other wrinkles.

When I tried you button it worked fine but threw up a confirmation dialogue. I wasn't sure if this was the idea, it was easy enough just to hit return. Maybe that is one of the wrinkles you detected.

I'm afraid I now find that the original button is bust. It threw up the window that you, I think, found when trying something else.

But I have yet to reboot, which sometimes resets things like that.

Maybe something will come out of this after all.

Now, all I have to do is to work out how to have a button that does "Initial caps".

Now that we know what actually caused the crash... forget my button - use Leo's suggestion - which should just plain work for you without the dialog:

@NoDeselect Rename PATTERN="%%20" TO=" " FINDREP

Not sure what you mean by "Initial Caps"... new thread time :slight_smile:!!!

Duh. I forgot that %% wrinkle.

Works now.

Of course, none of this explains why I can out this function on a toolbar button without everything blowing up in my face.

Let's case off the crash (blowing up in your face) as a totally separate issue as the rename command not working the same between toolbar and context menu (which I'd say is only teasing or "laughing" in your face as opposed to blowing up :slight_smile:)...

The rename command not working the same between buttons is probably an issue that GPSoft can look at - though I'd say it's a lower priority since double "%" chars can be used to escape the chars and make it behave as intended - in both context menu AND toolbar (for consitency).