Replace %20 button crashes DOpus

Too many websites deliver pdf files that have "%20" instead of a space, " ".

I can use DOpus to replace this if I go through the "manual" rename process.

But if I create a button in a context menu, DOpus crashes.

Error 0xC000000f at address 0x77D2114B.

I have used:

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

It is an exact copy of something that corrects another naming problem:

@NoDeselect
Rename PATTERN="_" TO=" " FINDREP

The "%20" button works fine on a toolbar. It is just the context menu that blows up.

I put the button in a context menu in "Files". (Settings>>File Types>>All files".) Other functions work fine there. This one just blows up.

Is this the wrong place to put it?

I can't repeat this here - it seems to work fine. Is it repeatable consistently? Does it only happen on certain filenames, etc?

Please follow the instructions here for submitting crash reports.

Somethings definitely not right though...

For me, this command (when run from a context menu item) just pops up the rename dialog (as opposed to actually performing the rename - which DOES work when the same command is run from a toolbar button)...

But perhaps lending towards the crash you're seeing, the dialog that I get is pre-filled with unexpected data (see the screencap) - which I suppose is fertile ground for an exception of some sort, thought I don't know why we're not all seeing the same thing...

Notice:

  • the data in the 'Old name' and 'New name' fields; as well as
  • the fact that the dialog has NOT been put into 'Find and Replace' mode; as well as
  • the weird look of the item in the preview area... you'll have to take my word for it that I selected an actual "file" and not a "folder" with "no name at all" :wink:...

Funnily, I have had a similar experience when using a different button. But I put it down to my incompetence.

Rename PRESET="Title Case"

Throws up the "Replace" window, with .

I borrowed that one from a message I read somewhere here. I was looking for a button for title case because I can't seem to make it work by creating my own version.

[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:.