DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: DONE: Hotkey copy filename then append it to a URL in clipboard for pasting  (Read 15,943 times)

XpFMk

  • Participant
  • Joined in 2010
  • *
  • Posts: 2
First off, I'd be very grateful to anyone who may do this. I've tried to read up some about how to do this using AHK but don't know where to begin.

What it would do: You select a file and press a hotkey (left winkey & C would be nice) it then copies the filename eg: image.jpg to clipboard and prefixes a set url to it.
End result would hopefully be hxxp://examplewebsite.info/image.jpg that you could use the normal ctrl+v to paste into an IM window.
It would be very nice for those who have a little web server off a home computer and send links to friends/family very often. It saves quite a bit of time in the long run. In the past year I've taken over 3,800 screenshots and linked every single one of them by typing out the full url and file name by hand.
Preferably in .ahk rather than .exe so the url can be easily edited.

I truly thank you for your time.

skwire

  • I eat Coding Snacks for breakfast...
  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,297
    • Participated in NANY Challenge Seventeen Times
    • Coding Snacks
    • Superboy Coder
    • Cody Award
    • Volunteers/Staff
    • Gathering Badge
Here you go.  Adjust as necessary.

Code: (autohotkey)
#c::
{
    SendInput, ^c ; Copy image path to clipboard.
    SplitPath, Clipboard, myFileName ; Get filename from the path.
    Clipboard := "http://www.site.com/" . myFileName ; Concatenate string and copy it to the clipboard.
}
Return
« Last Edit: August 01, 2010, 04:22 AM by skwire »

XpFMk

  • Participant
  • Joined in 2010
  • *
  • Posts: 2
Thank you very much  :)

Original address: https://www.donationcoder.com/forum/index.php?topic=23593.0