corz.org uses cookies to remember that you've seen this notice explaining that corz.org uses cookies, okay!
global $Ctrl = false
global $Shift = false
if _IsPressed(11) then $Ctrl = true
if _IsPressed(10) then $Shift = true
if $CmdLine[0] then
global $copy = ""
for $i = 1 to $CmdLine[0]
global $path = $CmdLine[$i]
if $Ctrl then $path = FileGetShortName($path)
if $Shift then
local $UNC_Array = _WinNet_GetUniversalName($path)
$path = $UNC_Array[1] & $UNC_Array[2]
endif
if StringRight($path, 1) = '"' then
$path = StringTrimRight($path, 1)
$path = StringTrimLeft($path, 1)
endif
$copy &= $path & @CRLF
next
ClipPut(StringStripWS($copy, 3))
else
MsgBox(0, "'Clipboard As Name', from corz.org ", "To use: Drag and drop stuff onto me, or a shortcut to me. " & @LF & @LF & _
"The path information will be placed in your system clipboard," & @LF & _
"so you can immediately paste it wherever you need it (Ctrl+V). " & @LF & @LF & _
"Okay, technically, you could also launch me with paths on the " & @LF & _
"command-line, but to save typing, you would first need to get " & @LF & _
"those paths into your clipboard, which is of course, my job! " & @LF & @LF & _
"Hold down the Ctrl key while you drag & drop for the 'short' path. " & @LF & _
"Hold down the Shift key for REAL network path of a mapped resource.")
endif
func _IsPressed($Key)
local $kp = DllCall('user32.dll', "int", "GetAsyncKeyState", "int", '0x' & $Key)
if not @error and BitAND($kp[0], 0x8000) = 0x8000 then return 1
return 0
endfunc
short" paths)
0.2 Added multiple files capability
0.1 One line of code. cool!
"
Welcome to corz.org!
Since switching hosts (I hope you are alright, Ed! Wherever you are …) quite a few things seems to be wonky.
Juggling two energetic boys (of very different ages) on Coronavirus lockdown, I'm unlikely to have them all fixed any time soon. Mail me! to prioritise!