Hover over a file on your desktop or folder. A tooltip will appear showing the icon for the file type and the path of the file.
Drag it into an open Excel file
Drop it and a hyperlink will be created in the active cell
Notes:
-used HotKeyIt's ToolTip Library.
-the icon's for the tooltips are .png files with transparency.
Instructions:
1) Press "\\" to run the script
2) Hover over a file on your desktop or folder and hold down the Shift key.
3) Drag the cursor to an Excel worksheet and release the Shift key.
4) A hyperlink to the file will be created.
**After each drop.. make sure to reload the script with "\\" so the shift key doesn't conflict with other scripts
Download:
Excel - Drag & Drop Hyperlinker
YouTube:
GRpbcJEdPBQ
-Used "\\" to run after each time
-Hold Shift key to drag to Excel
#SingleInstance Force :*:\\:: ;########## Copy file path ########### Loop { GetKeyState, state, Shift if (state = "D") { clipboard = SendInput, ^c ClipWait Clipboard := Clipboard break } Sleep, 50 } ;####################################### gosub, Label_show_TT ;########## Paste hyperlink to path in Excel ########### Loop { GetKeyState, state, Shift if (state = "U") { Click Sleep, 100 Click 2 SendInput, ^k WinWaitActive Insert Hyperlink SendInput, ^v Send, {enter} break } Sleep, 50 } ;####################################### gosub, Label_Remove return ;http://www.autohotkey.com/community/viewtopic.php?p=404058#p404058 ;######### Label_show_TT ############### Label_show_TT: SplitPath, Clipboard,,,ext, ;get extension of file on Clipboard TT:=TT(),TT.Show(Clipboard,"","","Link to:", find_icon(ext),"") ;create ToolTip Loop { GetKeyState, state, Shift if (state = "D") { TT.Show() ;show ToolTip at mouse coordinates Sleep, 10 } else { TT_Remove() break } } return ;####################################### Label_Remove: TT_Remove() return ;######### find_icon ############### find_icon(ext) { SetWorkingDir, %A_ScriptDir%\Icons ;MsgBox, %A_WorkingDir%\xltrans.png if (ext = "xlsx" or ext = "xls" or ext = "xlsm") icon_file = %A_WorkingDir%\Excel.png else if (ext = "docx" or ext = "doc") icon_file = %A_WorkingDir%\Word.png else if (ext = "pdf") icon_file = %A_WorkingDir%\PDF.png else if (ext = "ahk") icon_file = %A_WorkingDir%\AHK.png else if (ext = "") icon_file = %A_WorkingDir%\Folder.png else icon_file = %A_WorkingDir%\Other.png return icon_file } ;#######################################
Ideas and improvements welcome!