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
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
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
ReplyDeleteprobably 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