AutoHotkey Community

It is currently May 27th, 2012, 9:03 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: October 18th, 2011, 9:43 pm 
Offline

Joined: April 19th, 2011, 4:55 am
Posts: 298
I would like to press ctrl + left click on a file and then the file name goes to the clipboard. My files will be on my desktop or various folders and will be Excel, Word, PDF, JPEG, PNG... etc.

For example, after the script is run I will have these on the clipboard:


C:\Users\Bob\Desktop\Book1.xls

Or...

C:\Users\Bob\Desktop\Book2.pdf


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 18th, 2011, 10:25 pm 
Offline

Joined: June 18th, 2008, 8:36 am
Posts: 4923
Location: AHK Forum
:?:
Code:
Ctrl & LButton::
   Send {Ctrl up}{Click}
   Clipboard:=""
   Send ^c
   ClipWait,0.2
   Clipboard:=Clipboard
Return

_________________
AHK_H (2alpha) AHF TT _Struct WatchDir Yaml _Input ObjTree RapidHotkey DynaRun :wink:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 18th, 2011, 11:15 pm 
Offline

Joined: April 19th, 2011, 4:55 am
Posts: 298
Exactly what i'm looking for. Thank you


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2011, 12:33 am 
Offline

Joined: September 15th, 2009, 1:14 am
Posts: 562
Location: Tempe, Arizona
HotKeyIt wrote:
Code:
   Clipboard:=Clipboard

Not to hijack the thread, but can you quickly explain why you're assigning the variable Clipboard to itself? I get the gist of the rest, but I don't understand why you have that line of code.

_________________
Disclaimer: I'm not an expert by any means; I just try to help out where I can.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2011, 9:13 am 
http://www.autohotkey.com/wiki/index.ph ... ting_files


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 19th, 2011, 12:35 pm 
Offline

Joined: December 26th, 2010, 7:40 pm
Posts: 4172
Location: Awesometown, USA
codybear wrote:
Not to hijack the thread, but can you quickly explain why you're assigning the variable Clipboard to itself? I get the gist of the rest, but I don't understand why you have that line of code.
www.autohotkey.com/docs/misc/Clipboard.htm ← see 'Basic Examples'

_________________
Autofire, AutoClick, Toggle, SpamWindow Control Tools
Recommended: AutoHotkey_L


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], BrandonHotkey, hyper_, iBob35555VR, tomoe_uehara and 70 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group