View Issue Details

IDProjectCategoryView StatusLast Update
0002499Double CommanderDefaultpublic2023-07-07 17:16
Reporternicker Assigned ToAlexx2000  
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionno change required 
ProjectionnoneETAnone 
PlatformX64OSWindowsOS VersionWindows 10 2004
Product Version1.0.0 (trunk) 
Summary0002499: Add option to copy filename to clipboard using slashes instead of backlashes under Windows
DescriptionThat includes:

Copy filename only [CTRL+SHIFT+X]
Copy full file path [CTRL+SHIFT+C]

Most times I find myself changing backslashes to slashes.
Windows has almost full compatibility to forward slash. It is worth thinking making it the default state.
TagsNo tags attached.
Fixed in Revision
Operating system
Widgetset
Architecture

Activities

Skif_off

2020-06-24 00:07

reporter   ~0003449

> It is worth thinking making it the default state.

O_o It's strange idea... "\" is path delimiter on Win by default.

Save text between ----------- as (for example) "Back2Slash.lua":
-----------
-- Back2Slash.lua (cross-platform)
-- 2020.06.24
--
-- Copy seleted filenames to clipboard.
-- One parameter: %LU

local params = {...}

if params[1] == nil then
  Dialogs.MessageBox('Check parameter.', 'Back2Slash.lua', 0x0030)
  return
end
local h, err = io.open(params[1], 'r')
if h == nil then
  Dialogs.MessageBox('Error: ' .. err, 'Back2Slash.lua', 0x0030)
  return
end
local s = h:read('*a')
h:close()
if s == nil then
  Dialogs.MessageBox('Unknown error.', 'Back2Slash.lua', 0x0030)
  return
end
s = string.gsub(s, '[\r\n]+$', '')
if SysUtils.PathDelim == '\\' then s = string.gsub(s, '\\', '/') end
Clipbrd.SetAsText(s)
-----------

now http://doublecmd.github.io/doc/en/toolbar.html : add button with internal command "cm_ExecuteScript" and two parameters:
path-to-script\Back2Slash.lua
%LU

nicker

2021-08-22 01:49

reporter   ~0003794

Very nice !
I wasn't aware of lua integration.

I've used your script and overridden the default hotkey CTRL+SHIFT+C and I kept the toolbar hidden. so the desired outcome is completely achieved crookedly.

That also "solves" issue 0001920 for me, since you can use the toolbar for that.

I find it weird that creating new commands are tightly coupled to the toolbar

Issue History

Date Modified Username Field Change
2020-06-23 14:30 nicker New Issue
2020-06-24 00:07 Skif_off Note Added: 0003449
2021-08-22 01:49 nicker Note Added: 0003794
2023-01-08 19:28 Alexx2000 Assigned To => Alexx2000
2023-01-08 19:28 Alexx2000 Status new => closed
2023-01-08 19:28 Alexx2000 Resolution open => no change required