cm_copySrcPathToClip with trailing backslash
Moderators: Hacker, petermad, Stefan2, white
cm_copySrcPathToClip with trailing backslash
Hello,
there are a couple of commands for copying paths and file names to the clipboard. Very frequently I need the current path in the clipboard to use it in the 'Save As'-dialog of some other program.
'cm_copySrcPathToClip' is provided for that purpose, unfortunatly it is necessary to manually add a trailing backslash). I therefore used Lst2Clip that provides copying with trailing backslash, but now I use TotalCmd also in an environment that does not allow me to use that external program.
My suggestion is that cm_copySrcPathToClip (and cm_CopyTrgPathToClip to keep it consistent) adds a trailing backslash by default (or that additional built-in commands would be available with that functionality).
As the other commands like cm_AddPathToCmdline or <Ctrl p> add a trailing backslash I do not see the reason why cm_copySrcPathToClip does not. BTW, the current behaviour also is inconsistent as a backslash is added for the root directory (C:\ instead of C:).
Cheers,
Jesco
there are a couple of commands for copying paths and file names to the clipboard. Very frequently I need the current path in the clipboard to use it in the 'Save As'-dialog of some other program.
'cm_copySrcPathToClip' is provided for that purpose, unfortunatly it is necessary to manually add a trailing backslash). I therefore used Lst2Clip that provides copying with trailing backslash, but now I use TotalCmd also in an environment that does not allow me to use that external program.
My suggestion is that cm_copySrcPathToClip (and cm_CopyTrgPathToClip to keep it consistent) adds a trailing backslash by default (or that additional built-in commands would be available with that functionality).
As the other commands like cm_AddPathToCmdline or <Ctrl p> add a trailing backslash I do not see the reason why cm_copySrcPathToClip does not. BTW, the current behaviour also is inconsistent as a backslash is added for the root directory (C:\ instead of C:).
Cheers,
Jesco
OK, so that makes sense.C:\ and C: are different paths
@Hacker: thanks for that link. However, my main point was to support the functionality as a built-in command as I use TotalCmd on computers where I am not allowed to install additional software. Copying paths is such a basic functionality that I think also the flavour with trailing backslash could be implemented in the program itself.
Cheers,
Jesco
Many software doesn't require installation, you can simply unpack it and use everywhere. E.g. you can simply put Lst2Clip executable to TC dir and call it in a user-command via environment variable %COMMANDER_PATH%.
BTW C: w/o backslash in DOS/Windows specifies current directory on C:\ drive. It even works in TC: enter e.g. C:\Windows, then switch to another drive and execute command cd C:. You will return back to C:\Windows.
BTW C: w/o backslash in DOS/Windows specifies current directory on C:\ drive. It even works in TC: enter e.g. C:\Windows, then switch to another drive and execute command cd C:. You will return back to C:\Windows.
Yes, but in my case executing programs other than preinstalled is forbidden by policy rather than technically impossible.Many software doesn't require installation
Yes, agreed.C: w/o backslash in DOS/Windows specifies current directory
It would still be more consistent if a backslash would be appended in any case when executing cm_copySrcPathToClip. It is probably the functionality I use most in TotalCmd: in any 'Save As' dialog of any software rather than navigating within the dialog by mouse I prefer to navigate to the target directory using TotalCmd and then copy and paste the path in front of the filename - it's annoying to manually append a \ every time.
Cheers,
Jesco
What a strange policy:) do they check _every_ executable you start? Even TC dir contains many EXEs that TC may use...
Also I don't understand why do you need to append trailing backslash to path in 'Save as' dialog. You can easilly paste path w/o it and press Enter - dialog will open that directory and then you will be able to enter filename. Or you type filename w/o entering directory?
It is really interesting BTW why TC adds trailing backslash when I copy dir path using cm_CopyFullNamesToClip but strips it when using cm_CopySrcPathToClip.
Also I don't understand why do you need to append trailing backslash to path in 'Save as' dialog. You can easilly paste path w/o it and press Enter - dialog will open that directory and then you will be able to enter filename. Or you type filename w/o entering directory?
It is really interesting BTW why TC adds trailing backslash when I copy dir path using cm_CopyFullNamesToClip but strips it when using cm_CopySrcPathToClip.
cm_copySrcPathToClip with trailing backslash
Hello,
now that the new program version approaches its release date I want to ask for my suggestion again: add a trailing backslash to output of command cm_copySrcPathToClip. Is there a chance that this behavior will be changed or is there any good reason that the backslash is missing?
Cheers
Jesco
now that the new program version approaches its release date I want to ask for my suggestion again: add a trailing backslash to output of command cm_copySrcPathToClip. Is there a chance that this behavior will be changed or is there any good reason that the backslash is missing?
Cheers
Jesco
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
I'm not sure I see the problem. Explorer's Open/Save dialog treats the following as the same (after Enter is pressed)
c:\TestDir\SubDir
c:\TestDir\SubDir\
Both open to C:\TestDir\SubDir ...
Although when the "\" slash is present it's messier as a drop-down occurs to choose other subfolders or files within that path.
Also not including the trailing slash is standard among pretty much any program that splits a full path into it's respective parts - even AHK and CMD Batch. Granted it may not make entirely logical sense, since when you split something like
C:\TestDir\SubDir\TestFile.txt -->
PATH: C:\TestDir\SubDir
FILE: TestFile.txt
You have to manually add the seperator back when concatenating the string back together.
c:\TestDir\SubDir
c:\TestDir\SubDir\
Both open to C:\TestDir\SubDir ...
Although when the "\" slash is present it's messier as a drop-down occurs to choose other subfolders or files within that path.
Also not including the trailing slash is standard among pretty much any program that splits a full path into it's respective parts - even AHK and CMD Batch. Granted it may not make entirely logical sense, since when you split something like
C:\TestDir\SubDir\TestFile.txt -->
PATH: C:\TestDir\SubDir
FILE: TestFile.txt
You have to manually add the seperator back when concatenating the string back together.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
Hello,
I explained the reason for my suggestion in the first post (and subsequent ones): (a) some program presents me a 'File Save'-dialog, (b) the target directory is already open in Total Commander, (c) instead of clicking through the folder tree in the dialog, I copy the path from Total Commander and paste it in front of the file name => but I always have to add an additional backslash.
Cheers
Jesco
I explained the reason for my suggestion in the first post (and subsequent ones): (a) some program presents me a 'File Save'-dialog, (b) the target directory is already open in Total Commander, (c) instead of clicking through the folder tree in the dialog, I copy the path from Total Commander and paste it in front of the file name => but I always have to add an additional backslash.
Cheers
Jesco
Because the filename is already filled in for most of these dialogs, I would loose that name using the steps you proposed.MVV wrote:Sorry but we don't understand why can't you press Enter after pasting path to filename field of Save dialog in order to open that path and then simply enter just filename w/o path.