Is there any way of catching an error...

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Dustydog
Posts: 321
Joined: 13 Jun 2016 04:19

Is there any way of catching an error...

Post by Dustydog »

...for things like cancelling out of an interactive rename within a script? Without completely working around it?

I hope this isn't a rtfm situation.

highend
Posts: 15004
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Is there any way of catching an error...

Post by highend »

And your code for an "interactive rename" is?
One of my scripts helped you out? Please donate via Paypal

Dustydog
Posts: 321
Joined: 13 Jun 2016 04:19

Re: Is there any way of catching an error...

Post by Dustydog »

Unless I'm getting around it with an input statement for a single rename, I'm just using the most basic possible:

rename b, "$renameTo", p;

I find his preview feature quite convenient. it gives a nicely formatted and width-appropriate last chance with the possibility of using bulk rename syntax to add something to the front or back instead of accepting the entire calculated rename. Suppose I could always just rename to * without cancelling, which for a lack of a better word seems untidy, but that's beyond the scope. (Eventually I'll probably use an edit filenames box, but I'm not there yet as what I'm doing is pretty convoluted and somewhat interactive.)

Was simply curious in general if there was any way of doing an: OnError {Do This;}.

I assume, "No." But thought I'd ask.

highend
Posts: 15004
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Is there any way of catching an error...

Post by highend »

Because that command has no return value, the only way to check would be by
comparing the before / after names :mrgreen:

So:
OnError {Do This;}
No, not in a general way...
One of my scripts helped you out? Please donate via Paypal

Post Reply