topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 10:29 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: clean the marked text  (Read 9188 times)

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
DONE: clean the marked text
« on: October 09, 2018, 04:06 AM »
cyber_archaeology_in_the_holy_land__the_future_of_the_past
^My eyes dislike this file name very much. Not because of the words, but because of those 11 ugly _
When I look at it, my instinctive reaction is to rename it, like the 2'nd file in this screenshot from Explorer:

2.jpg

For many years I have been using Dolphin Text Editor, and been happy with it. One day, still many years ago, they updated the program and my favourite feature disappeared! Instead of changing the world, I tried to change myself... Now I realize it is far more realistic to change the world! Please help me to do so: I would very much like a small exe (to be placed in Start) that will clean the marked text for every "_" (shortcut "Ctrl+_", if possible), meaning, Replace it with a Space.

Please?  :tellme:
« Last Edit: September 29, 2020, 06:10 AM by Curt »

highend01

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 188
    • View Profile
    • Donate to Member
Re: DONE: clean the marked text
« Reply #1 on: October 09, 2018, 04:20 AM »
AHK (compile it, place it in start, use it's shortcut when a text with underscores is in the clipboard):

#NoEnv
#SingleInstance Force

^+-:: ; Ctrl+Shift+- = Ctrl+_
Clipboard := RegExReplace(Clipboard, "[_]+", " ")


tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Re: DONE: clean the marked text
« Reply #2 on: October 09, 2018, 04:22 AM »
Hi Curt,
is it the text editor that adds the underscores?
(If so, are you planning on continuing using it?)

One day, still many years ago, they updated the program and my favourite feature disappeared!
what was that feature?
Tom

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
Re: DONE: clean the marked text
« Reply #3 on: October 09, 2018, 04:30 AM »
@highend01 So fast... Wow!
Forgive me: I don't have AHK or any familiar version installed any more. Will You or someone else please exe compile it for me?

=//= Warning - while you were typing a new reply has been posted. You may wish to review your post. =//=

tomos, you said "adds", but meant the opposite. But No, it comes from a site that uses "underscores" in every file name.

highend01

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 188
    • View Profile
    • Donate to Member
Re: DONE: clean the marked text
« Reply #4 on: October 09, 2018, 04:39 AM »
AHK doesn't need to be installed to be able to compile a script with it. Just use the current .zip: https://autohotkey.com/download/ahk.zip

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Re: DONE: clean the marked text
« Reply #5 on: October 09, 2018, 04:48 AM »
tomos, you said "adds", but meant the opposite.
;D no I didnt -- but I properly understand the situation now :up:
Tom

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
Re: DONE: clean the marked text
« Reply #6 on: October 09, 2018, 04:55 AM »
yes! tested with Ctrl+Shift+- success!

Thank You, highend01  :up:
YOU HAVE BEEN DONATED

=//= Warning - while you were typing a new reply has been posted. You may wish to review your post. =//=

@tomos, Re-reading my first posts, I can see I wasn't as clear in my mouth as in my imagination...  :-[

Finished Program
« Last Edit: October 16, 2018, 05:10 AM by Curt »

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: DONE: clean the marked text
« Reply #7 on: October 09, 2018, 11:39 AM »
File managers like Directory Opus have features to rename files autmagically, if you instruct them to do so. For example, I created a button that converts selected files/folders (spaces to dots, capitalize every first character of each word in the name and clean up possible double dots in the name) all in one go.

And I don't think I even have scratched the surface of this specific functionality in Directory Opus. Other decent file managers like Total Commander, XYplorer etc. have similar functionality available to them, I'm sure.

Curt

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 7,566
    • View Profile
    • Donate to Member
Re: DONE: clean the marked text
« Reply #8 on: October 09, 2018, 12:28 PM »
^ yes, Shades, I kind of remember this. I was so disappointed with DO 8+9+9.5, that I don't even have the installers any more. It simply takes me far too long to understand how to use the program well. My copy of XYPlorer was too boring, compared to Explorer - yes, Explorer - but of course I can still have a change of mind, because of the generous lifetime key.

noblejoker

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 20
  • Father & Husband, Biz Owner, PC user & Blogger,
    • View Profile
    • My PC USers Group - Posts & Discussions
    • Donate to Member
Re: DONE: clean the marked text
« Reply #9 on: December 06, 2018, 07:09 PM »
AHK (compile it, place it in start, use it's shortcut when a text with underscores is in the clipboard):

Just a thank you for the AHK script code
I have added this to my always running AHK script and call the cleaning with a different keyboard shortcut - Win+K
I also added a second run to remove the dash and replace with nothing as I need that for certain operations
Looks like this now
#K::
Clipboard := RegExReplace(Clipboard, "[_]+", " ")
Clipboard := RegExReplace(Clipboard, "[-]+", "")
Return
Matt from Australia