Rename Special modify _to Spaces script request
-
JimXYUser
- Posts: 23
- Joined: 23 Nov 2012 00:26
Rename Special modify _to Spaces script request
the Right-Click -> Rename Special has a
_ to Spaces
can some1 help me with a script that add more then just replacing the underscore? I wanted it to replace - and + as well, with space.
e.g. filename_has-this_and+this.exe
change to:
filename has this and this.exe
Can i extend the Rename Special to make the changes above? thanks.
_ to Spaces
can some1 help me with a script that add more then just replacing the underscore? I wanted it to replace - and + as well, with space.
e.g. filename_has-this_and+this.exe
change to:
filename has this and this.exe
Can i extend the Rename Special to make the changes above? thanks.
-
j_c_hallgren
- XY Blog Master
- Posts: 5826
- Joined: 02 Jan 2006 19:34
- Location: So. Chatham MA/Clearwater FL
- Contact:
Re: Rename Special modify _to Spaces script request
Hi and welcome to the XY forums!
Have you looked at using the existing "Search and Replace" variant instead? I believe that would do it...
Have you looked at using the existing "Search and Replace" variant instead? I believe that would do it...
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
-
highend
- Posts: 14942
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Rename Special modify _to Spaces script request
What he said^^Have you looked at using the existing "Search and Replace" variant instead?
Code: Select all
_-+>spaceOne of my scripts helped you out? Please donate via Paypal
-
JimXYUser
- Posts: 23
- Joined: 23 Nov 2012 00:26
Re: Rename Special modify _to Spaces script request
where can i find "Search and Replace"? I only able to get F3 (quick search) and F12 (search location).
-
highend
- Posts: 14942
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Rename Special modify _to Spaces script request
Em, right click a file, Rename Special, Search and Replace...?
One of my scripts helped you out? Please donate via Paypal
-
JimXYUser
- Posts: 23
- Joined: 23 Nov 2012 00:26
Re: Rename Special modify _to Spaces script request
thanks highend, for letting me know where is the "Search and Replace".
But by using "Search and Replace" i need to type in each time i wanted to do a replacement. would it be better if i have a script to do it.
But by using "Search and Replace" i need to type in each time i wanted to do a replacement. would it be better if i have a script to do it.
-
j_c_hallgren
- XY Blog Master
- Posts: 5826
- Joined: 02 Jan 2006 19:34
- Location: So. Chatham MA/Clearwater FL
- Contact:
Re: Rename Special modify _to Spaces script request
I normally access it via File>Rename Special menu for the selected fileJimXYUser wrote:thanks highend, for letting me know where is the "Search and Replace".
Previously used S&R strings are stored and available via dropdown at right end so not much retyping....But by using "Search and Replace" i need to type in each time i wanted to do a replacement. would it be better if i have a script to do it.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
-
JimXYUser
- Posts: 23
- Joined: 23 Nov 2012 00:26
Re: Rename Special modify _to Spaces script request
manage to find the answer, put this code in User -> Manage Commands -> location, then set a hot key.
now each time i select some files, press the hot key and all files will be formatted with empty space.
now each time i select some files, press the hot key and all files will be formatted with empty space.
rename s, "-/ "; rename s, "_/ "; rename s, "+/ ";
-
j_c_hallgren
- XY Blog Master
- Posts: 5826
- Joined: 02 Jan 2006 19:34
- Location: So. Chatham MA/Clearwater FL
- Contact:
Re: Rename Special modify _to Spaces script request
Why do you have 3 separate renames? Won't one with "-+_/ " work just as well?JimXYUser wrote:manage to find the answer, put this code in User -> Manage Commands -> location, then set a hot key.
now each time i select some files, press the hot key and all files will be formatted with empty space.
rename s, "-/ "; rename s, "_/ "; rename s, "+/ ";
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
-
admin
- Site Admin
- Posts: 66300
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Rename Special modify _to Spaces script request
This way, please:
Code: Select all
rename s, "+-_> ";FAQ | XY News RSS | XY X
-
JimXYUser
- Posts: 23
- Joined: 23 Nov 2012 00:26
Re: Rename Special modify _to Spaces script request
why '/' can be replace by '>' ?
-
admin
- Site Admin
- Posts: 66300
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Rename Special modify _to Spaces script request
I has to be replaced else it does not work.JimXYUser wrote:why '/' can be replace by '>' ?
FAQ | XY News RSS | XY X
-
PeterH
- Posts: 2827
- Joined: 21 Nov 2005 20:39
- Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%
Re: Rename Special modify _to Spaces script request
Oh dear, I'm multiple confused now
I didn't really understand the help for the Scripting Command "Rename". (That's what we are talking about.) Description of operand "pattern" says: "[Required] The pattern to be applied. Its syntax may vary depending on which mode is used, see below for more." But "below" I find almost nothing...
Then I had the idea to look for help for the Menu Command "Rename" - but: this is not so easy to find - it doesn't seem to exist in any way in Contents (German: "Inhalt") of Help.
But if you search for "Rename" either by "Index" or by "Search" (German: "Suchen") you can find it. It's "File Menu / Rename Special (Submenu)"
So I think you should
1) give a hint (and maybe a direct link) in "Scripting Command / Rename" to "File Menu / Rename Special (Submenu)", and
2) in the index of help there should be a chapter for "Menu Commands", with entries for help pages like "File Menu".
Just another point: shouldn't the first operand for the Rename scripting command (in the examples) be quoted for clean syntax, i.e. "s"?
I didn't really understand the help for the Scripting Command "Rename". (That's what we are talking about.) Description of operand "pattern" says: "[Required] The pattern to be applied. Its syntax may vary depending on which mode is used, see below for more." But "below" I find almost nothing...
Then I had the idea to look for help for the Menu Command "Rename" - but: this is not so easy to find - it doesn't seem to exist in any way in Contents (German: "Inhalt") of Help.
But if you search for "Rename" either by "Index" or by "Search" (German: "Suchen") you can find it. It's "File Menu / Rename Special (Submenu)"
So I think you should
1) give a hint (and maybe a direct link) in "Scripting Command / Rename" to "File Menu / Rename Special (Submenu)", and
2) in the index of help there should be a chapter for "Menu Commands", with entries for help pages like "File Menu".
Just another point: shouldn't the first operand for the Rename scripting command (in the examples) be quoted for clean syntax, i.e. "s"?
-
admin
- Site Admin
- Posts: 66300
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Rename Special modify _to Spaces script request
1) give a hint (and maybe a direct link) in "Scripting Command / Rename" to "File Menu / Rename Special (Submenu)", and
Already there.
Just another point: shouldn't the first operand for the Rename scripting command (in the examples) be quoted for clean syntax, i.e. "s"?
Yes, but in the case of one-letter flags one can be a bit tolerant.
The "i" button in the Rename Special dialogs contains all necessary information.
Already there.
Just another point: shouldn't the first operand for the Rename scripting command (in the examples) be quoted for clean syntax, i.e. "s"?
Yes, but in the case of one-letter flags one can be a bit tolerant.
The "i" button in the Rename Special dialogs contains all necessary information.
FAQ | XY News RSS | XY X
-
PeterH
- Posts: 2827
- Joined: 21 Nov 2005 20:39
- Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%
Re: Rename Special modify _to Spaces script request
Me badadmin wrote:1) give a hint (and maybe a direct link) in "Scripting Command / Rename" to "File Menu / Rename Special (Submenu)", and
Already there.
But I've stopped reading after having reached the example for "rename s, ..."
I'm afraid this happens to others, too? So maybe it would be better to include it more at the top - for example direct behind the bold word Syntax?
My impression is that people often have problems with quoting strings. I just don't think it helps when strings sometimes are shown unquoted.admin wrote: Just another point: shouldn't the first operand for the Rename scripting command (in the examples) be quoted for clean syntax, i.e. "s"?
Yes, but in the case of one-letter flags one can be a bit tolerant.![]()
And I think I remember that severals months ago you said that you cannot guarantee that unquoted strings maybe lead to errors in the future...
Though I must say: for these option-letters it looks better if they are unquoted :-(
XYplorer Beta Club