Skip to main content

Making Windows' 'Send To' More Powerful With AutoHotKey and TeraCopy

I'm a real stickler for organizing my files on my computer. Every file type has its right place to be within my directory structure. I regularly cut and paste files from my download/USB/wherever folders, and then paste them into the right location, after navigating to that folder, but I wanted to do it a better way. I wanted to be able to right click on the file, and then send it to its destination, with only one click (well two if you count the right click).

Now Windows has its 'Send To' option in the right click menu, however that copies the file. I would obviously then have to remember to delete the file from the source directory once the copying was completed. This would be a fine solution, however I wanted to do it even quicker than that. And that also leaves open the problem of possibly not knowing which files have been sent (when sending multiple files).

There is also the option of adding the 'Move to Folder' (usually found in Edit > Move To Folder) to the right click menu, but this pops up a directory chooser, which means I would then have to find the folder that I want the files to go to. This would prove to be slower than simply cutting and pasting.

In comes AutoHotKey. If you're unfamiliar with AutoHotKey, you should check it out here. Basically it gives incredible power to be able to automate tasks on your computer.

I first created a very simple script that I saved into the Windows 'Send To' folder (C:\Users\{username}\AppData\Roaming\Microsoft\Windows\SendTo), so it would appear in the Send To menu when I right click on a file. The script reads in the file name(s) of the file that was right-clicked on, and then, using the built in FileMove function of AutoHotKey, moved to the destination that I have set. This worked perfectly for most files, however for big files (multiple GBs), there was no feedback to show the progress of the file transfer. The cursor would have the loading icon, which would eventually disappear, and then a short time later, the file would disappear too (into the destination directory). So I decided I would interface my script with a file transfer program, TeraCopy (check it out here). TeraCopy allows for parameters to be passed to the executable when it's run, which would initiate either a Copy or a Move, so I took advantage of this.

I replaced the call to FileMove in my AutoHotKey script with a call to the Run command, and gave it the full path to TeraCopy, then 3 parameters;
Move - indicating to TeraCopy that I want to move the file,
Source - The source filelist, preceded with a * to indicate to the program it was reading in a list of files.
Destination - The directory to be moved to.

And that was it. Now my Send To menu will actually do as it says, and send the file to the directory chosen, not send and keep a copy. For an organisation freak like myself, this is going to make that organisation so much more efficient.

I've attached the script to the end of this blog, so you can check it out, customise it, and make use of it yourself!

This won't be the final version of the script, it's literally the very first version, that I wrote this morning in about 10 minutes, and thought that it would be a great starting block for people out there who might want something similar. I have a few of these scripts, that all do the same thing, but go to a different directory, however I may look at consolidating them all into one script, and having the destination determined dynamically in the script, depending on the extension of the file being moved. All possible thanks to the awesome power of AutoHotKey.

The script:

To use this script, you need to download and install AutoHotKey, then create a new .ahk file in your 'Send To' directory (see above for exact location). Paste the above code, update the variable 'Destination' and also the path to TeraCopy (if different). Save the script, and you're ready to go. Just right click on a (or many) file, go to Send To, and select the name of the script from there, and the magic will happen.

Current Limitations:
The script can't move folders yet, it only works on files. I will figure out how to fix that and post and update here when that's done.

Hopefully someone else will find this useful also.
Denno

Comments

  1. Hi Denno I enjoyed your blog I am working on similar matters with the intention of having a dedicated move to option on my context menu that opens the same easily augmentable send to listing
    probably as a a program link for a compiled AutoHotKey script
    which will be easy to add using the great default program editor
    http://defaultprogramseditor.com/
    Perhaps we can talk
    Did you ever go beyond your first 10 minute script??
    I. e, including folders as intimated and consolidating your stuff??
    I spent 30 minutes at Adelaide Airport in 2007 changing planes from en route from the Alice to Melbourne
    my name is John Fowles (UK born now in New Jersey USA)my email is my name backwards at Hotmail.com my web site is a work in progress at johnfowles.org.uk
    Here's hoping to hear from you

    ReplyDelete

Post a Comment

Popular posts from this blog

Reverse Advent Calendar

I've created a reverse advent calendar, whereby instead of kids receiving a small gift/chocolate/lolly each day of December leading up to Christmas, they choose a toy/belonging that they will give up, and donate to a charity that will pass it on to children who otherwise wouldn't get any gifts on Christmas. I know my nephew is going to be showered with gifts this Christmas, more than he'll be able to play with, which also means that a lot of the toys he's received previously will be pushed to the bottom of the toy box. Most of these toys are in near perfect condition, which would make it a shame for them to be forgotten at the bottom of a box, they could actually be enjoyed by another child. By choosing toys to donate, and understanding why he's doing it, he'll learn generosity and selflessness, knowing that he's helping to make another child's Christmas as good as his. There's also the advantage that his room won't get so messy with an ov

Large Format printing at home

I found this really great wallpaper online that I liked so much, I decided I wanted to hang it up in my room, as a poster. Being an impatient person, I wanted to be able to print it out myself so I could hang it straight up. I had seen this effect done before online somewhere, and throught it would be perfect for printing this picture out nice and large. This is the result: View from bedroom door From the foot of the bed As you can see, the bottom of the picture isn't quite complete because my printer ran out of Black ink, so it refused to go on, even though there was plenty of colour ink.. quite annoying. To create it, I made a large Photoshop document, to the exact size for 5x4 A4 sheets of paper, with 1cm gaps in between. Then using masks and exporting each section to a different image and printing, I was able to put them together to look like this. Very happy with the result, however printing onto glossy paper would have given it a much better look. I may end up