I am a programmer, so it would be useful if the "Copy names" (Alt+C) command would copy the file name to the clipboard transformed so that it is suitable for use inside C++/Python etc source code. That is, the \ characters would be changed to \\. This should of course be optional behavior.
I know of course using hardcoded filenames in code is bad practice, but it often is quite convenient to do that while prototyping or when doing tools just for myself...
Feature request for the "Copy names" command
Moderators: fgagnon, nikos, Site Mods
You might look into the free utility ClipboardFusion which allows you to add/change/replace/remove any given text inside the clipboard - this can be set to be done automatically upon capture (it works fine with x2's Alt-C, etc).
It is easily configured to replace '\' with '\\'.
And, as it's casually indifferent to humanity's ultimate purpose, it cares not whether what you change is "best practice" or not. Of course, perhaps if we install enough utilities, AI emergence will become a reality, and then you might be critiqued upon form and faculty.
It is easily configured to replace '\' with '\\'.
And, as it's casually indifferent to humanity's ultimate purpose, it cares not whether what you change is "best practice" or not. Of course, perhaps if we install enough utilities, AI emergence will become a reality, and then you might be critiqued upon form and faculty.
You can achieve this with autohotkey and X2 user commands
Create a blank txt file and paste following code in it
Save this file as C:\Temp\CopyEscapedPath.ahk
Create a new user command as
assign a hotkey for this user command or add it to your toolbar.
This will work for a single selected file. For multiple files you can easily modify the above script to accept $A instead of $P as parameter. Use a loop to iterate over all the selected files.
Create a blank txt file and paste following code in it
Code: Select all
param = %1%
StringReplace, NewStr, param, \, \\, All
clipboard = %NewStr%
Create a new user command as
Code: Select all
>"C:\Program Files (x86)\AutoHotkey\AutoHotkey.exe" "C:\Temp\CopyEscapedPath.ahk" "$P"
This will work for a single selected file. For multiple files you can easily modify the above script to accept $A instead of $P as parameter. Use a loop to iterate over all the selected files.
Help! I'm an AI running around in someone's universe simulator.
Yes, I am aware there are external applications that can help with this, but I'd rather keep my system as "clean" as possible. I would not need for example Autohotkey at the moment for anything else, so it would be a bit heavy additional thing to have running in the system just for a little thing like this. Meh, maybe I'll just write my own clipboard transformer app then... :P
In that case you could compile your autohotkey script as standalone exe file and uninstall autohotkey.
If you do not want to go autohotkey route and you only want to use whats already installed on your machine then you can also rewrite the script I mentioned above using vbscript which comes preinstalled on all versions of Windows.
Nikos blogged about this here
Your request is very user specific, what if I wanted the paths seperator to be replaced with '/' instead of '\\' for my samba share on my Linux machine? I won't count on this feature to ever be implemented directly in X2.
If you do not want to go autohotkey route and you only want to use whats already installed on your machine then you can also rewrite the script I mentioned above using vbscript which comes preinstalled on all versions of Windows.
Nikos blogged about this here
Your request is very user specific, what if I wanted the paths seperator to be replaced with '/' instead of '\\' for my samba share on my Linux machine? I won't count on this feature to ever be implemented directly in X2.
Help! I'm an AI running around in someone's universe simulator.