Jump to content

Get path of file mouse is presently located @


Guest B-52H
 Share

Recommended Posts

New to scripting...

1) Is an AutoIt script possible, that would write to the Clipboard: the path of the file that the cursor is presently hovering over (say, in an Explorer window that presently has the focus)?

(This, so I can subsequently paste the Clipbrd's text string into another application's 'Save As' Text Entry Box.)

2) Can the resulting script be added to the Context Menu (right mouse button)?

Thanks!

Link to comment
Share on other sites

There is no need for a "hover over" action, since you could send the file to a script that saves the file's full path to the clipboard.

However, there already are programs out there that do what you want. I use one, and if you give me a few minutes I'll edit this post to link to a freeware one that I use.

Edit: Here is a link to a program called "Send to Toys" that has, amoung other really convient options, an option called "Send to clipboard (as name)" that will copy the full path of the item selected to the clipboard when used. All selected options will appear in a new right click sub-menu called "Send to" when you install the program.

Although it would be possable to do this with AutoIt and modifying the proper registry entry to add it to the right click menu, I recomend this program since it has other useful options as well. Plus it adds the menu stuff for you, so you don't need to worry about it.

Edited by pekster

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

Thanks, pekster ...installed it, and it does what you said it would. However, I'm looking to copy only the file's path (and without the double quotes!)

Link to comment
Share on other sites

Okay, if you want to customize the result to conform to a specific method, here's what you're going to want to do:

Set a script up to do whatever handeling of the path that's passed to it, including sending it to the clipboard if this is what you wish. Save this script in a directory that will always be accessable (IE not on a removable medium.)

Next, you'll need to add support into the context (right click) menu. Go into regedit, and navigate to the HKEY_CLASSES_ROOT\*\shell section, and add a new key. The name you give it is not important for it's function, so name it so you can know it's purpose. Edit the default value to be the name you wish to appear in the right click menu. Then, create a new subkey with the name of "command" (no quotes) and edit the default value to point to your script. Example: you're script is in C:\scripts\my_script.exe . You would edit the data to say: C:\scripts\my_script.exe "%1" . It is very important that you enclose the %1 in double quotes so that files with spaces in them are handeled correctally.

Also, you will need double quotes around the program path if it contains a space.

And in case you didn't figure this out by now, you will have to detect the passed paramater in AutoIt and do something with it.

Edited by pekster

[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...