Labels

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%