Labels

February 13, 2016

Controlling the Script run and Overwrite

When a script is running already, and we need to see the changes we made after the last run, '#SingleInstance' can save us the time and effort of clicking everytime the ok button that we are asked to.

#SingleInstance force ;skips the dialog box and replaces the old instance automatically
#SingleInstance ignore ;skips the dialog box and leaves the old instance running
#SingleInstance off ;allows multiple instances of the script to run concurrently

February 7, 2016

Removing Side Scroll Bar from Edit

You can make our Edit Gui ScrollBar free, by adding a
just one key word at the end:

Gui, Add, Edit, vMainEdit WantTab W180 R14 -VScroll

This will create an edit gui of width 180px and height 14 characters, without any scroll bar.

January 27, 2016

Managing Tabs in Autohotkey

Tabs represent different sub-categories of a main category or topic like a table having results of all the students has many sub domains of a major domain, Subject:
    1.)Subject
          i) Mathematics ii)English iii) Science  iv)Social Science

You can handle each type doing different things, like each subject displays marks of each student, hence you need to read a different file for each tab. You can do many things in each tab without applying a common setting that appears in every tab:

Loop, parse, mainTabNames, |
{
    Gui, Tab, %A_Index% ;Lets you handle each tab separately  
 
      Gui, Add, ListView, r15 w450 Grid, Name of File/Folder                   |Shortcut(HotKey)
      
    Loop, Read,%A_Index%.ini                       ;Load the marks of each subject from                                 {                                                                   ;files names as per the subject i.e.- <Subjectname>.ini
      LV_Add("",A_LoopReadLine,A_LoopReadLine)
    }

  

January 17, 2016

Reading a File and placing each line in One Tab in reverse order

Like, you wanna make some customised 'Tab' window where you can add or delete one or more tabs as per the requirement, You need to save a list of all the tabs in a file and then read it each time you launch your script:

Loop, Read, settings.ini                                      
{
    mainTabNames= %A_LoopReadLine%  | %mainTabNames% 

Gui,font,S12 cGreen,Calibri
Gui, Add, Tab,x%mainTabX% y%mainTabY% w%mainTabWidth% h%mainTabHeight%, %mainTabNames%
Gui,Show

Note: the tabs will be added in reverse order of the index of lines in the file.

January 7, 2016

Reading a File Name and Display its Name

Just copy the file and read the clipboard:

Send,{ctrl down}c{ctrl up} ;to copy the file/folder path
ClipWait
FileFullPath=%Clipboard%  ;stores the clipboard in FileFullPath
SplitPath,FileFullPath, name, dir, ext, name_no_ext, drive
MsgBox, ,Selected file,The selected file is %name%