ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Main Area and Open Discussion > General Software Discussion

AutoHotkey script to replace spaces in file names with underscores

<< < (2/5) > >>

lanux128:
lanux128, many thanks for the script! I'm having a bit of trouble with it though. As I'm using an Apple keyboard, there isn't a Win key. So I changed WIN+D to ALT+V. After that I was able to have one successful instance, but after that it wouldn't do it, even when I reload the script.

This makes me wonder if some bits of this script interfere with some other bits in my file. I don't know anything about AutoHotkey, but for example I already have this elsewhere in the file:-dr_andus (May 21, 2014, 03:18 PM)
--- End quote ---

are you running the script by itself or you copy-pasted in to your main script? i have added more error-trapping in case copying to clipboard somehow fails so please check out the new script from the above link.

btw, what OS are you running this on? it works fine here on Win 7 Pro (x64).

NB: currently there are a few AHK forks. fyi i am using this one, previously known as AHK_L.

dr_andus:
i have added more error-trapping in case copying to clipboard somehow fails so please check out the new script from the above link.-lanux128 (May 21, 2014, 09:21 PM)
--- End quote ---

lanux128, thank you for your efforts.

are you running the script by itself or you copy-pasted in to your main script?-lanux128 (May 21, 2014, 09:21 PM)
--- End quote ---

I tried it both ways. Unfortunately even after restarting the system I wasn't able to deploy the script at all. There must be some conflict with some of my other scripts, I presume.

btw, what OS are you running this on? it works fine here on Win 7 Pro (x64).

NB: currently there are a few AHK forks. fyi i am using this one, previously known as AHK_L.
-lanux128 (May 21, 2014, 09:21 PM)
--- End quote ---

I'm also using Win7 (x64) and AHK_L.

dr_andus:
I actually managed to run your script once, after I suspended all my other scripts. However, when I re-enabled some of them, it stopped running. And when I disabled them again, your script still wouldn't run again. So there is something that only allows it to run once, even if the interfering scripts are disabled again.

I thought I managed to narrow it down to this script as the interfering one, but I'm not entirely sure:

;-----------------------
; ALT+W to count words  |
;-----------------------

!W:: ; ALT + W to activate script
ClipSaved := ClipboardAll   ; Save the entire clipboard to a variable of your choice.
Clipboard := 
Send ^c
; Send {Left}
ClipWait, 2
StringReplace, clipboard, clipboard, ', x, All
ClipWait, 2
StringReplace, clipboard, clipboard, -, x, All
RegExReplace( Clipboard, "\w+", "", Count ) ; PhiLho
Clipboard := ClipSaved

; To have a ToolTip disappear after a certain amount of time
; without having to use Sleep (which stops the current thread):
#Persistent
ToolTip, Word Count: %Count%
SetTimer, RemoveToolTip, 5000
return

RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
Return
--- End quote ---

rjbull:
Do you use a clipboard manager like ArsClip or CHS?  If so, you could use their search-and-replace feature to do this.  Or, try Clippy or Text Monkey, which I mentioned in a previous thread: Explote a clip from the clipboard

dr_andus:
Do you use a clipboard manager like ArsClip or CHS?  If so, you could use their search-and-replace feature to do this.  Or, try Clippy or Text Monkey, which I mentioned in a previous thread: Explote a clip from the clipboard
-rjbull (May 22, 2014, 03:51 PM)
--- End quote ---

Thanks for the suggestion. However I'd really prefer to use AutoHotkey for this, so that the whole operation can be carried out by a series of keyboard shortcuts in one place, rather than having to switch to another software window and then back again.

lanux128's script really does what I want, it's just that I'm running into a conflict with some of my other AutoHotkey scripts somehow...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version