Learn tips and tricks to make your life easier, increase productivity and to streamline the work flow. Join me in a my journey to learn AHK.
Saturday, December 5, 2009
I'll explain the script later and if you dont know what AHK is....then read my previous posts and AHK's built in documentation.
Here goes the script. Copy the following into your AHK Script file.
;|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Menu, pasteLoc, add, Audio, cAudio ;Add menu item Audio
Menu, pasteLoc, add, Anime, cAnime ;Add menu item Anime
Menu, pasteLoc, add, Games, cGame ;Add menu item Game
Menu, pasteLoc, add, EBooks,cEbooks ;Add Menu item EBooks
cAudio:
FileCopyDir, %clipboard%, F:\Audio\Personaly Downloaded\Current\%name%
return
cAnime:
FileCopyDir, %clipboard%, G:\Anime\%name%
return
cGame:
FileCopyDir, %clipboard%, G:\Game Installers\%name%
return
cEbooks:
FileCopyDir, %clipboard%, E:\E-Books\%name%
return
F1::
clipboard =
send, ^c
ClipWait
SplitPath, clipboard, name
Menu, pasteLoc, show
return
;||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
All you have to do is to select the folder by clicking it and press F1 key. A menu will show up with the predefined locations, click the one where you want to copy the folder and Yup that's all. No navigating through hundred of folders or anything.
Explaination:
A little explanation would be better here. First four lines create a context menu with items Audio, Anime, Games and E-Books. You can add more according to your needs like you may want to add another item for Movies or something. Next 4 text blocks are actually the actions which should initiate when you click the corresponding Item. For example when you click on item E-Books, 4th text block (or as we say in AHK a Label) cEbooks will initiate and your content will be copied to E:\E-Books folder.
After the four labels, we have assigned an action to our F1 key. Actions assigned ti io in plain English means that upon pressing F1, AHK will clear the clipboard hence removing any previously present content there. Then it sends KeyStroke Ctrl+C and then waits for the object to be copied in the clipboard. With this method Complete Name (Path+FolderName) is stored on the clipboard. By using splitPath we separate the folder name from the Complete Name. After doing everything listed above it SHOWS a menu, having items we specified in the first four lines of our script.
Customizing to your Needs:
Customizing is pretty easy instead of writing about it here I have wrote all the parameters in the script.
Limitation:
This script can be used to copy the folders only.
Download The Script (With Customization Guide)
Thursday, November 26, 2009
Study, Study &... Study [Blog Is ALIVE]
So after all this chi chi talk, I assure you that I'll start posting more frequently after just a few days and hope that you'll keep on visiting, ignoring my laziness.
ShahrezRafiq
Sunday, November 8, 2009
Media Remote - Use Keyboard To Control Any Media Player
I am kind of lazy...you see, I don't want to move my mouse all over the screen just to maximize my Media Player window in order to select next song or to raise the volume so due to my frustration over XP (Windows7 supports Jumplists... Far better!), I created this handy setup.
Basically it modifies CapsLock as a modifier (for starters: it makes CapsLock act as Ctrl, Alt or Shift Key) and then we can use A,S,D, Mouse Wheel Up and Mouse Wheel Down to Raise/Low volume or to select Next/Previous track.
If you are new to AutoHotKey [AHK] please give a whirl to your mouse and read my previous post.
1 - Create a new AHK Script file.
2- Edit it and copy/paste the following into it.
;||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||Start of Script
CapsLock&WheelUp::
send, {Volume_up}
return
CapsLock&WheelDown::
send, {Volume_down}
return
CapsLock&s::
send, {media_play_pause}
return
Caps/Lock&a::
send, {media_prev}
return
CapsLock&d::
send, {media_next}
return
;||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||End of Script
3 - Save it, Run it and Enjoy.
Most of the script is self explanatory so will dive right into what this script is supposed to do.
So pressing a,s,d or rolling mouse wheel up or down while holding CapsLock pressed will result as following.
"CapsLock + WheelUp" ( Roll Mouse Wheel Up) will rise you system volume.
"CapsLock + WheelDown" (Roll Mouse Wheel Down) will lower the system volume.
"CapsLock + a" will play the previous track you were listening.
"CapsLock + d" will select the next song in your media player playlist.
"CaspLock + s" will play/pause the current track.
AHK's documentation is a great way to get started with AHK in no time read it and experiment. Who knows you may succeed in ejecting your DVD drive door just by pressing a key.
Friday, November 6, 2009
Turn CapsLock into Mute Toggle Key
Do you know that out of many useless keys on the keyboard, CapsLock holds the first position for being the most useless one. I have never used it or seen anybody use it. Most of time we try to hold our sweet Shift key.
To make it really useful we'll have to use an application called AutoHotKey [AHK]. AHK basically remaps the keys and associate different kinds of action with the keyboard or mouse keys. We'll use this software to make CapsLock useful, believe me, very useful.
Lets stat by installing AHK, setup is pretty straight forward so you can really do it on your own.
Now this is the time to take a very deep breath.
Start Notepad or any other text editor of your choice. I usually prefer Notepad2 or Sublime. [B'cause they look kinda cool ^_^]
write the following in your file:
CapsLock::
send, {Volume_Mute}
return
Now let me explain what does that script ACTUALLY mean.
"CapsLock::" is the name of the key to which we are assigning the Toggle Mute Action.
"send" instructs the AHK to send a keystroke or in plain simple English it asks the AHK to press the button.
"{Volume_Mute}" is a key (Present on Multimedia Keyboards) to be pressed. In our case this key may or may not be present on our Keyboard. If it's not AHK will simply simulate it and will assign its action to the CapsLock key hence giving you an easier approach to mute the babbling.
"return" asks the AHK to return from the subroutine.
Now, Save the file with the name of your choice but don't forget to put the extension of " .ahk ".
With AHK installed run the script you just created and viola now you can toggle the mute on or off just by pressing that old rusty CapsLock key.