Showing posts with label automation. Show all posts
Showing posts with label automation. Show all posts

Friday, February 13, 2015

#AHK Swap ctrl with ALT and highlight to copy text

Here is a nice Autohotkey command to set up the  and swap ctrl with ALT and highlight to copy text.

Copy with highlight because I worked with terminal a lot and had to manually copy and paste into the terminal.
If I do not want the highlight to copy the items, just kill the ahk process from the taskbar, and life is normal again! Note that it is only effective to the highlights by the left click and drag. Not the shift and arrow highlights.

To activate the ahk script, save the script as alt-ctrl-mouse.ahk. Install AHK software, then drag the script file to startup folder inside the start menu. The script will be activated when you log in.

; Switches the left Control and Alt keys.

LCtrl::Alt

LAlt::Ctrl
; code below are used to copy the mouse-highlighted items.
 
~$LButton Up::
{
 Send ^c
    Sleep 2
}
return

Friday, January 6, 2012

Do not Repeat the task

In one of my work, the funny thing happened. The matlab could not save some of the finished task. It might be memory issues or what not... I am not sure. So, I wanted to run the program in such a way that it would not repeat the finished task while still running the new work.
This script does it!
:)


% inDIR is the directory containing the save work
if exist([inDIR],'dir')>0

disp(['not doing ::: ', inDIR])

writeout = ['echo "not doing ::: ', inDIR, '">>notes.txt'];
system(writeout)

% do nothing
else

% do it command here!!
end