Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Send to Clipboard as Name


  • Please log in to reply
2 replies to this topic
Venia Legendi
  • Members
  • 35 posts
  • Last active: Apr 04 2011 08:36 PM
  • Joined: 27 May 2005
Adds Send to Clipboard as Name to the current users send to explorer context menu - Ok, not new, but I needed something witch runs without installation. Demands to be compiled, which is really not needed on systems where autohotkey is installed...

#singleinstance force
IfLess, 0, 1
If A_IsCompiled
{
	SendToDir = %UserProfile%\SendTo
	IfNotExist, %SendToDir%
	{
		MsgBox, 16,, %SendToDir% not found
		ExitApp
	}	
	StringTrimRight, ScriptName, A_ScriptName, 4
	FileCreateShortcut, %A_ScriptFullPath%, %SendToDir%\%ScriptName%.lnk
		, %A_ScriptDir%,,Send to Clipboard as Name,,%A_ScriptFileFullPath%
	MsgBox, 64,, Shortcut %SendToDir%\%ScriptName%.lnk generated
	ExitApp
}
else
{
	MsgBox, 16,, Compile me.
	ExitApp
}
ClipBoard=
Loop, %0% ; For each parameter:
{
	IfGreater, A_Index, 1
		clipboard = %clipboard%`n
	clipboard := clipboard %A_Index% 
}
CoordMode, ToolTip, Screen
ToolTip, %clipboard% -> ClipBoard,0,0
Sleep, 2000


Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
That something like this works via a shortcut in SendTo is very interesting.

Here are some alternate approaches in case you ever need them:

1) Use "ControlGet, List, List, Selected Col1, SysListView321, A" to get the selected files names. However, this won't get their paths, which would be a disadvantage if you're using it in a file-search window.

2) Copy the files directly from Explorer via Ctrl-C. For example, the following converts the selected files to their full paths and also sorts them alphabetically:

#c:: ; Win+C hotkey
clipboard =
Send, ^c
ClipWait, 2
Sort, clipboard ; This also converts to text.
return

Thanks for sharing your SendTo shortcut approach, which I think will be useful for quite a few things.

Venia Legendi
  • Members
  • 35 posts
  • Last active: Apr 04 2011 08:36 PM
  • Joined: 27 May 2005

That something like this works via a shortcut in SendTo is very interesting.


I use send to a lot, it's more convient when browsing large file system with the mouse. Normally I use Gabriele Ponti's send to extensions http://www.gabrieleponti.com/, but they need to be installed.

In the same way (autohotkey) I've implemented: send to lost+found and make comment file (with extension txt) ...