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

<< < (4/5) > >>

lanux128:
I had a quick go, got an error message showing file paths with underscores added - but there is no change to focused files.
No change if I also run the Count_words script.
I see that these paths are also copied to the clipboard.
 (see attachment in previous post)
Win7 x64 / UAC on highest setting / AHK_L
-tomos (May 23, 2014, 03:11 AM)
--- End quote ---
@tomos: thanks for testing out. :-* don't worry, the changed text is only stored in clipboard. in any case, you can press Ctrl+v to paste the new contents.

lanux128:
Thanks for all your help. I have UAC switched off. I've never seen that tray balloon pop up, but then I only managed to execute the script twice so far, and after both instances things got messed up.

I'm starting to think that the problem may have to do with some conflict with my Apple keyboard remapping. For example, I get different behaviour with clipboard related shortcuts depending on the types of shortcut keys I use. Also, when I tried to set up a hotkey for the ArsClip macro and hit Command, which is mapped as Win, it showed up as Win+CTRL. So I suspect a lot more is happening when I press certain keys than I'm able to see.
-dr_andus (May 23, 2014, 03:32 AM)
--- End quote ---

since the script worked on tomos' PC, we can isolate the Apple keyboard and see how AHK recognises the key presses. right-click on a running script and select 'Open'. from the window that appears, go to View|Hotkey and their methods. now you can see how your hotkeys are registered. it should look like this then post it here.

AutoHotkey script to replace spaces in file names with underscores

Anyway, here is my keyboard remapping script, in case anyone might be able to spot the culprit in there:
-dr_andus (May 23, 2014, 03:32 AM)
--- End quote ---

i don't think there is anything wrong here.

tomos:
I had a quick go, got an error message showing file paths with underscores added - but there is no change to focused files.
No change if I also run the Count_words script.
I see that these paths are also copied to the clipboard.
 (see attachment in previous post)
Win7 x64 / UAC on highest setting / AHK_L
-tomos (May 23, 2014, 03:11 AM)
--- End quote ---
@tomos: thanks for testing out. :-* don't worry, the changed text is only stored in clipboard. in any case, you can press Ctrl+v to paste the new contents.
-lanux128 (May 23, 2014, 06:04 AM)
--- End quote ---

ah okay - I misunderstood - I thought it was intended to actually rename the files.

dr_andus:
Thanks, lanux128, here it is (though it doesn't say much to me  :)



dr_andus:
In the meantime a kind soul who had seen the above had emailed me a script that does work within my particular setup, so my problem is solved. Thank you very much for all your help.

Here is the script, in case anyone else runs into this problem:


--- ---;----------------------------------------------
; CTRL+SHIFT+Z Replace spaces with underscores |
;----------------------------------------------

^+z::
clipboard=
Send, ^x
StringReplace, clipboard, clipboard, %A_Space%, _, All
Send, ^v
Return

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version