There have been times where I've pasted some text that has illegal characters and I don't notice them or simply forget about them but upon clicking OK the script fails because I use that input as a filename and Windows doesn't accept certain chars.
Could you add an option so XYplorer auto replaces on paste the illegal characters or just don't accept them showing an error?
Option to auto-replace illegal chars on input dialogs
Re: Option to auto-replace illegal chars on input dialogs
What's an "illegal" character ?
Re: Option to auto-replace illegal chars on input dialogs
And how should XY know what purpose your input has in advance ?
If you make such errors often you can add a routine to your scripts to make a check according to some rules.
If you make such errors often you can add a routine to your scripts to make a check according to some rules.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
Portable XYplorer (actual version, including betas)
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
Re: Option to auto-replace illegal chars on input dialogs
In Windows are: ":", """ (quote), "?", "*", "\", "/", "<", ">" and "|" . Also you can't name "con", "com#" or "nul" any file or folder.
I was thinking by implementing a name input dialog command or adding a param so we can set a dialog to be like that.
Re: Option to auto-replace illegal chars on input dialogs
You could just do it with a:
Code: Select all
$input = '"a<>b|*c?d\e/f'; // You'd be using an input() here...
$input = regexreplace($input, "(^(con|com#|nul)$|[""?*\\/<>|])", "_");
One of my scripts helped you out? Please donate via Paypal
Re: Option to auto-replace illegal chars on input dialogs
I will try that, thank you!highend wrote: ↑23 May 2021 19:48 You could just do it with a:
Code: Select all
$input = '"a<>b|*c?d\e/f'; // You'd be using an input() here... $input = regexreplace($input, "(^(con|com#|nul)$|[""?*\\/<>|])", "_");