AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

nDroid (formerly 320MPH) Ultra Fast Anything-Launcher
Goto page Previous  1, 2, 3 ... 17, 18, 19
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
fures



Joined: 31 Jan 2008
Posts: 23

PostPosted: Sat Apr 26, 2008 7:06 pm    Post subject: Reply with quote

HI

I fiddled with some things, and here is the result:

- bloody fast due to some icon handling improvements
- can scan network drives into a separate index, and one can switch to this index on the fly - to keep speed for local search
- image preview even faster

look into the options (right click or AppsKey) what you can setup.

I use it and I love the fact that I can change the code... Laughing

Code:

;#NoTrayIcon
#SingleInstance FORCE
AutoTrim, Off
SetWorkingDir %A_ScriptDir%
SetBatchLines, -1
 OnMessage( 6, "WM_ACTIVATE" )
MainWnd = X_%A_ScriptName%
SetKeyDelay, 0
id320 = -1
;; ID of 320 MPH Screen
;___________________________________________
Process, Priority,, High
Menu, Tray, Icon, Shell32.dll, 23 ;23 57 172 210
Menu, Tray, Tip, %MainWnd%

SetTimer,UPDATEDSCRIPT,1000

   IniFile = %A_ScriptDir%\320MPHX.ini
   IniGui_IniFile:=IniFile
   
   IfNotExist, %IniFile%
      GoSub, WriteIni
   GoSub, ReadIni

IndexFile = %A_ScriptDir%\%ListFile%
   ;AlwaysScan := ExpandVars(AlwaysScanI)
   PathListX := ExpandVars(PathList)
   OpenFolderWithX := ExpandVars(OpenFolderWith)

Start320:
   StringRight, ExtChk, A_ScriptFullPath, 4
   IfEqual, ExtChk, .exe
      If ShellIntegration
      {
         RegWrite, REG_SZ, HKCR, *\Shell\320MPH\Command,, "%A_ScriptFullPath%" "`%1"
         RegWrite, REG_SZ, HKCR, Folder\shell\320MPH\command,, "%A_ScriptFullPath%" "`%1"
      }
      Else
      {
         RegDelete, HKCR, *\Shell\320MPH,
         RegDelete, HKCR, Folder\Shell\320MPH,
      }

   RParam = %1%

   ;create scanned result list on first run
   IfNotExist, %A_ScriptDir%\%ListFile%
      GoSub, ButtonScan

   ;Check scan date and create menus
   GoSub, CheckScanDate_and_CreateMenus


   ;;JWJ - Avoids drawing GUI again
   if id320 <> -1 ;not the 1st run
      Return

   ;///////////////////////////////////////////////////////////////////////////////////

   ;Read scan file in ItemList
   GoSub, ReadScanFile


   ;Make Gui
   GuiX := ;X0 !!!
   GuiY := ;Y26 !!!
   LVGuiW := 263 ;GuiW - 12
   GuiMargin := 15
   GuiH := 560

   GuiW := LVGuiW + (GuiMargin * 2) ;275 volt, 10 115 - 232 645
   LVGuiH := GuiH - GuiMargin - 48 - 20 - 20 - 5 ;64
   StatusY := GuiH -3 - 20 ;25
   Status2Y := GuiH -3 - 20 - 20 ;25
   FEditX := GuiW - GuiMargin - 150
   FEditTY := GuiMargin + 5
   IconSize := 1

   Gui, -Caption +Border +lastfound
   mgH := WinExist()
   Gui, Color, %GuiColor%

   gui, font, s10, %GuiFont%
   Gui, Add, Text, % "x" GuiMargin "y" FEditTY-10, Search:
   Gui, Add, Edit, % "x+15 y" GuiMargin-10 " w200 vCurrText gGetText",
   gui, font, s9, %GuiFont%
   Gui, Add, ListView, Tile x%GuiMargin% y+30 w%LVGuiW% h%LVGuiH% vSelItem gSelection AltSubmit BackgroundBlack CWhite, Name|Ext|Folder
   Gui, Font
   Gui, Add, Button,x0 y0 w0 h0
   Gui, Add, Text, % "x" GuiMargin+0 " y" GuiMargin+10 " w60 h28 vResults",
   Gui, Add, CheckBox, % "x" FEditX+77 " y" StatusY " vFindInPath Right w83", &Find in Path
   Gui, Add, CheckBox, % "x" FEditX+77 " y" Status2Y " vShowTTip Right w83", Show &Tooltip
   Gui, Add, Picture, % "X" GuiW " Y" GuiMargin+65 " W200 H480", %Pth%
   Gui, Add, Text, x%GuiMargin% y%Status2Y%, Max item&s:
   Gui, Add, Edit, x+2 y%Status2Y% w35 h16 vMaxIt gGetText, %MaxItems%
   Gui, Add, Button, % "x" GuiMargin " y" StatusY-2 " h21 gChangeView", Change &View
   Gui, Add, Text, % "X" GuiW " Y" GuiMargin+45 " w0 h0" ;placeholder for the picture preview data-text
   Gui, Add, Button, % "x" GuiMargin+61 " y" GuiMargin-10+30 " w50 h22 gButtonOpen Default", &Open
   Gui, Add, Button, % "x+5" " y" " h22 gButtonDir", &Dir Open
   Gui, Add, Button, % "x+5" " y" " h22 gButtonDirTg", Target-Dir Open
   Gui, Add, Button, % "x+15" " y" " h22 gGoogle", &Google Search
   Gui, Add, Button, % "x+5" " y" " h22 gWikipedia", &Wikipedia

   Gui, Add, Button, % "x" GuiMargin+80 " y" StatusY-2 " h21 gScanNetwork", Scan Network Now!
   Gui, Add, CheckBox, % "x" GuiMargin+90 " y" Status2Y " gAltIndexFile Right w100", &Network Search
   Gui, Add, Text, % "x" GuiW " y" GuiMargin-10+3+5 " h20", Run-Params:
   Gui, Add, Edit, x+5 yp-3 w100 h20 vRParam, %RParam%

   ;pwb := IE_Add(mgH, GuiW, GuiMargin+40, 200, 200)

   Gui, Add, Text,  x0 y0 w%GuiW% h%GuiH% cFFFFFF Backgroundtrans +0x200 gGuiMove vMOVER


   LV_ModifyCol (1, 210) ;100

   Gui, Show, h%GuiH% w%GuiW% %GuiX% %GuiY%, %MainWnd%
   WinGetPos, GuiX, GuiY,,,%MainWnd%

   WinGet, id320, ID, A
   If FindInPath
     Control,Check,,Button2,%MainWnd%
   If ShowTTip
     Control,Check,,Button3,%MainWnd%
   ControlFocus, Edit1, %MainWnd%

; Gui, 2:+lastfound
; mgHIE := WinExist()
; pwb := IE_Add(mgHIE, 0, 0, 400, 300)
; Gui, 2:Show, NoActivate Hide x10 y50 w400 h300, Preview IE


   LastText = fadsfSDFDFasdFdfsadfsadFDSFDf

   If ShowBigView
      GoSub, ChangeView

   Gosub, GetText
   Control, Choose, 1, SysListView321, %MainWnd%

   GoSub, DoScan


Return
;______END of AUTOEXECUTE section______________________


ReadIni:
   ;;SplashImage design attribs:
   Spl_Design = y30 x800 w150 M C11 ZH0 ZW0 ZX5 ZY5 B1 CT236782 CWffffcc FM7 FS7 WM600 WS400
   Spl_Design2 = M C11 ZH0 ZW0 ZX5 ZY5 B1 CT236782 CWffffcc FM11 FS11 WM600 WS400

   GoSub, IniGui_Load
Return

WriteIni:
   ;Creating ini File - if not any
   FileAppend,
(
[Scanning]
PathList=%A_MyDocuments%|%A_StartMenuCommon%|%A_StartMenu%|%A_Desktop%|%UserProfile%\Favorites|%A_AppData%\Microsoft\Sablonok|%A_ProgramFiles%
;List of paths to scan
;Default=%A_MyDocuments%|%A_StartMenuCommon%|%A_StartMenu%|%A_Desktop%|%UserProfile%\Favorites|%A_AppData%\Microsoft\Sablonok|%A_ProgramFiles%
TypeList=exe|lnk|ahk|doc|xls|ppt|pdf|dot|xlt|pot|jpg|jpeg|tif|ico|wmf|emf|exif|ani|cur|mpg|mpeg|avi|mov|wmv|asf|url|txt|ini|log|gif|png
;List of extensions to scan for
;Use *** for any extension (time consuming scan!)
ExcludeList=about|history|readme|remove|unins|license
;Strings to exclude from scanning
IncludeList=mustreadme|readmeanyway|zsoft
;Strings to still include, even if in exclude list
;Example: All "uninst" are excluded, but ZSoft Uninstaller is still in
ScanFirefox=1
;Do you want to scan Firefox Bookmarks?
;Type=boolean
ScanPause=5
;A running scan will pause for this many seconds when you use your computer
ScanPeriod=2
;in hours. Scan in background every X hours.
ListFile=RunList.lst
;Name of the main index file

[Display]
ShowIcons=1
;Show icons in the list
;Type=boolean
FindInPath=0
;To search also in the path of files
;Otherwise, it only searches the file name
;Type=boolean
;Default=0
ShowTTip=0
;To show tooltip with detailed file info under the main window
;Type=boolean
ShowBigView=0
;Type=boolean
;To use the extended view of the main window
GuiFont=Trebuchet MS Félkövér
;Font to be used in the main window in case of small view
GuiColor=E3E3E3
;Background color of the main window
MaxItems=25
;Maximum number of search items to find

[Advanced]
OpenFolderWith=Explorer
;What program do you want to use to open folders of searched items
MaxLastUsed=25
;Maximum number of opened items to store in order to show when no search text is entered
WaitTime=200
;Milliseconds to wait for key strokes before search starts when you enter search text
MinLen=2
;Minimum characters before search starts
ShellIntegration=0
;Works only if compiled to exe!
;Shell Integration adds this script to all files' context menu, so that you can launch a file with any application selected in the script.
UsedList=|
;DON'T EDIT THIS UNLESS YOU KNOW WHAT YOU ARE DOING
;This contains the last opened items
),%IniFile%
Return


DoScan:
   ScanCheckTimerInt := 1 * (60*1000) ;mins

   SinceLast := A_TickCount-LastScanTick
   LastScanTick := A_TickCount
   SetTimer, DoScan, %ScanCheckTimerInt%


   GoSub, CheckScanDate_and_CreateMenus
   If (FDDiff > (-1*ScanPeriod)) ;less than X hours old listfile
   {
      ;MsgBox,Return at FDDiff
      Return
   }

   If (SinceLast-ScanCheckTimerInt > 10000) ;more than X msec late - coming from hibernate
   {
      ;MsgBox,Return at Late
      Return
   }

   If (A_TimeIdle < (20*1000)) ;Idle for X sec
   {
      ;MsgBox,Return at Idle
      Return
   }

   CntDn = 10
   Loop, %CntDn%
   {
      ;SplashImage,, %Spl_Design%,% "Scanning starts in " CntDn+1-A_Index " sec...",Computer idle
      If (A_TimeIdle < (20*1000))
      {
         GoSub, RemoveTrT
         Return
      }
      Sleep, 990
      ;GoSub, RemoveTrT
   }
   SetTimer, DoScan, Off
   Gosub, ButtonScan
   LastScanTick := A_TickCount
   SetTimer, DoScan, %ScanCheckTimerInt% ;mins
Return

AltIndexFile:
If not AltIndex
{
   IfNotExist,%A_ScriptDir%\Net%ListFile%
   {
      FileSelectFile, IndexFile2, 3, %A_ScriptDir%, Open a new IndexFile, *.lst
      If not IndexFile2
         Return
      IndexFile := IndexFile2
   }
   else
      IndexFile = %A_ScriptDir%\Net%ListFile%
   AltIndex = 1
}
else
{
   AltIndex =
   IndexFile = %A_ScriptDir%\%ListFile%

}
GoSub, ReadScanFile
ControlFocus, Edit1, %MainWnd%
GoTo, GetText
Return

ReadScanFile:
   SplashImage,, %Spl_Design2%,Please wait,Loading index...
   ItemList =
   FileGetSize, LFSize, %IndexFile%
   VarSetCapacity(ItemList,LFSize)

   ln =
   Loop, Read, %IndexFile%
   {
      IfEqual, A_LoopReadLine,
         Continue
      ln ++
      ItemList = %ItemList%|%A_LoopReadLine%
   }

   ; ln =
   ; Loop, Parse, ItemList, |
      ; ln ++
   SplashImage,OFF
   ;SplashImage,, %Spl_Design2%, % round(LFSize/1024) . " K = " . ln . " lines",Item list loaded
   ;SetTimer, RemoveTrT, 3000
Return

myShow(Smsg,Stitle,Sdesign="",Stime=3000,SonlyWhenActive=1)
{
Global
If SonlyWhenActive
   IfWinNotActive,%MainWnd%
      Return
Sdes := Spl_Design%Sdesign%
SplashImage,, %Sdes%, % Smsg, % Stitle
If Stime
   SetTimer, RemoveTrT, % Stime
Return
}

RemoveTrT:
   SetTimer, RemoveTrT, Off
   ;TrayTip
   SplashImage, OFF
return

MenuFold:
   Run, %A_ScriptDir%
Return

MenuEdit:
   Run, edit %A_ScriptFullPath%
Return

MenuSetup:
   GoSub, Hide320
   GoSub, IniGui_Setup
   ;Reload
Return

MenuIni:
   RunWait, %IniFile%
   Reload
   Sleep, 1300
Return

MenuRel:
   Reload
   Sleep, 300
Return

MenuEx:
   ExitApp
return

CheckScanDate_and_CreateMenus:
  FileGetTime, FDDiff, %A_ScriptDir%\%ListFile%, M  ; Retrieves the modification time by default.
  EnvSub, FDDiff, %A_Now%, minutes
  FDDiff := round(FDDiff/60,2) ;in hours
  SetTimer, CheckScanDate_and_CreateMenus, % 3 * (60*1000) ;mins

If MenuMade
{
   Menu, MyContextMenu, DeleteAll
   Menu, Tray, DeleteAll
}
MenuMade = 1

FDDiff_abs := abs(FDDiff)
FDDiff_min := round( (FDDiff_abs - floor(FDDiff_abs)) / 100*60*100, 0)
If (FDDiff_min < 10)
   FDDiff_min := "0" . FDDiff_min
FDDiff_time := floor(FDDiff_abs) ":" FDDiff_min

   Menu, MyContextMenu, Add, Open, ButtonOpen
   Menu, MyContextMenu, Add, Open containing folder, ButtonDir
   Menu, MyContextMenu, Add, Open target folder, ButtonDirTg
   Menu, MyContextMenu, Add, Show file info, MenuWin
   Menu, MyContextMenu, Add, Delete from list, MenuDel
   Menu, MyContextMenu, Add
   Menu, MyContextMenu, Add, % "Scan folders (last scan " . FDDiff_time . " ago)", ButtonScan
   Menu, MyContextMenu, Add, Scan-statistics, ScanStat
   Menu, MyContextMenu, Add
   Menu, MyContextMenu, Add, Change View, ChangeView
   Menu, MyContextMenu, Add
   Menu, MyContextMenu, Add, Setup options, MenuSetup
   Menu, MyContextMenu, Add, Edit settings (ini file), MenuIni
   ;Menu, MyContextMenu, Add, Save current settings (into ini file), WriteIni
   Menu, MyContextMenu, Add, Open script folder, MenuFold
   Menu, MyContextMenu, Add, Edit this script, MenuEdit
   Menu, MyContextMenu, Add
   Menu, MyContextMenu, Add, Reload this script, MenuRel
   Menu, MyContextMenu, Add, Exit, MenuEx

Menu, Tray, NoStandard
   Menu, Tray, Add, Open Search Window, Show320
   Menu, Tray, Add
   Menu, Tray, Add, % "Scan folders (last scan " . FDDiff_time . " ago)", ButtonScan
   Menu, Tray, Add, Scan-statistics, ScanStat
   Menu, Tray, Add
   Menu, Tray, Add, Setup options, MenuSetup
   Menu, Tray, Add, Edit settings (ini file), MenuIni
   ;Menu, Tray, Add, Save current settings (into ini file), WriteIni
   Menu, Tray, Add, Open script folder, MenuFold
   Menu, Tray, Add, Edit this script, MenuEdit
   Menu, Tray, Add
   Menu, Tray, Add, Reload this script, MenuRel
   Menu, Tray, Add, Exit, MenuEx
   Menu, Tray, Default, Open Search Window

Return

ScanStat:
      mExtList =
      Loop, Parse, ItemList, |
      {
      If not A_LoopField
         Continue
         CurrItem = %A_LoopField%
       IfInString,CurrItem,://
         FExt := "FFurl"
       else
         SplitPath, CurrItem, FName, FDir, FExt, FNameNoExt, FDrive
         mExtList = %mExtList%|%FExt%
      }
      Sort, mExtList, D|

      mExt =
      mCn =
      aCn =
      mSg =
      Loop, Parse, mExtList, |
      {
      If not A_LoopField
         Continue
        aCn ++
        IfEqual, mExt, %A_LoopField%
        {
          mCn ++
        }
        else
        {
          mSg = %mSg%%mExt%`t%mCn%`n
          mExt = %A_LoopField%
          mCn = 1
        }
      }
     MsgBox, %mSg%`n`nAll`t%aCn%
      mExtList =
Return

GetText:
   ControlGet, FindInPath, Checked,, Button2, %MainWnd% ;A FindInPath checkbox állapota
   ControlGetText, MaxItems, Edit2, %MainWnd%
   ControlGetText, CurrText, Edit1, %MainWnd%
   IfEqual, CurrText, %LastText%, Return
   StringLen, Check, CurrText

   IfGreater, Check, 0
      IfLess, Check, %MinLen%
         Return

   LastText = %CurrText%
   StartTime := A_TickCount
   moreth =

   ;from last used_____________________________
   IfEqual, CurrText,
   {
      If ShowIcons
      {
         IL_Destroy(ImageListID1)

         ; Create an ImageList so that the ListView can display some icons:
         ImageListID1 := IL_Create(10, 10, IconSize)
         ; Attach the ImageLists to the ListView so that it can later display the icons:
         LV_SetImageList(ImageListID1)
      }

      LV_Delete()

      Count =

      StringTrimLeft, UsedList0, UsedList, 1
      Loop, Parse, UsedList0, |
      {
         ;check for change in search query
         ControlGetText, CurrText, Edit1, %MainWnd%
         IfNotEqual, CurrText, %LastText%, Goto, GetText

         ;Firefox cucc feldolg
         CurrItem1 =
         CurrItem2 =
         StringSplit,CurrItem,A_LoopField,#
         If CurrItem2
         {
            FName = %CurrItem2%
            FDir = %CurrItem1%
            FNameNoExt = %CurrItem2%
            FExt =
         }
         else
         ;firefox feldolg vége
         SplitPath, A_LoopField, FName, FDir, FExt, FNameNoExt
         Count ++
         IfGreater, Count, %MaxLastUsed%, Break

         If ShowIcons
         {
            IfInString,FDir,://
            {
               IL_Add(ImageListID1,A_ProgramFiles "\Mozilla Firefox\firefox.exe",2)
               ;FExt := "FFurl"
            }
            else IfEqual,FExt,url
            {
               IL_Add(ImageListID1,A_ProgramFiles "\Internet Explorer\iexplore.exe",2)
            }
            else
            {
               hIcon := DllCall("Shell32\ExtractAssociatedIconA", UInt, 0, Str, A_LoopField, UShortP, iIndex)
               DllCall("ImageList_ReplaceIcon", UInt, ImageListID1, Int, -1, UInt, hIcon)
               DllCall("DestroyIcon", Uint, hIcon)
            }
         }
         LV_Add("Icon" Count, FNameNoExt, FExt, FDir )

      }
   }


   ;from all items_____________________________
   IfNotEqual, CurrText,
   {
      If ShowIcons
      {
         IL_Destroy(ImageListID1)

         ; Create an ImageList so that the ListView can display some icons:
         ImageListID1 := IL_Create(10, 10, IconSize)
         ; Attach the ImageLists to the ListView so that it can later display the icons:
         LV_SetImageList(ImageListID1)
      }

      LV_Delete()


      ;___________________________________________
      ; Advanced Search
      MatchPList1 =
      MatchPList2 =
      MatchPList3 =
      Count = 0
      Count2 = 0
      ln = 0



      GuiControl,, Results, Searching...


      Loop, Parse, ItemList, |
      {
         IfGreater, Count2, %MaxItems%, Break
         ;check for change in search query
         If (A_TickCount - StartTime > 1000)
         {
            ControlGetText, CurrText, Edit1, %MainWnd%
         }
         IfNotEqual, CurrText, %LastText%, Goto, GetText

         CurrItem = %A_LoopField%

         ;Firefox cucc feldolg
         CurrItem1 =
         CurrItem2 =
         StringSplit,CurrItem,A_LoopField,#
         If CurrItem2
         {
            FName = %CurrItem2%
            FDir = %CurrItem1%
            FNameNoExt = %CurrItem2%
            FExt =
         }
         else
         ;firefox feldolg vége
            SplitPath, CurrItem, FName, FDir, FExt, FNameNoExt, FDrive
         StringLower,FExt,FExt


         ;search everywhere or file name only
         ;fuzzy search

         If FindInPath
            Wht := CurrItem
         else
            Wht := FName

         MatchFound = Y

         Loop, Parse, CurrText, %A_Space%
         {

            StringLeft,opst,A_LoopField,1
            IfEqual,opst,-
            {
               IfEqual,A_LoopField,-dir
               {
                  IfEqual, FExt, lnk
                  {
                     FileGetShortcut, %CurrItem%, TargItem
                     SplitPath, TargItem, TargFName, TargFDir, TargFExt, TargFNameNoExt, TargFDrive
                     IfNotEqual,TargFExt,
                        MatchFound = N
                  }
                  else
                     MatchFound = N
               }
               else
               {
                  StringTrimLeft,Srch,A_LoopField,1
                  IfInString, Wht, %Srch%
                     MatchFound = N
               }
            }
            else ;not -excludeword
            {
               IfNotInString, Wht, %A_LoopField% ;vagy FName helyett CurrItem
                  MatchFound = N
            }
         }

         IfEqual, MatchFound, Y
         {
            MatchPList2 = %MatchPList2%|%CurrItem%
            Count2 ++
            Continue
         }

      } ;end of loop parse searchlist at line 479


      ;used only MatchPList2
      MatchPList = %MatchPList1%%MatchPList2%%MatchPList3%

      StringTrimLeft, MatchPList, MatchPList, 1

      Loop, Parse, MatchPList, |
      {
         ;check for change in search query
         ControlGetText, CurrText, Edit1, %MainWnd%
         IfNotEqual, CurrText, %LastText%, Goto, GetText

         Count ++
         IfGreater, Count, %MaxItems%
         {
            moreth := "+"
            Break
         }
         CurrItem = %A_LoopField%
         ;Firefox cucc feldolg
         CurrItem1 =
         CurrItem2 =
         StringSplit,CurrItem,A_LoopField,#
         If CurrItem2
         {
            FName = %CurrItem2%
            FDir = %CurrItem1%
            FNameNoExt = %CurrItem2%
            FExt =
         }
         else
         ;firefox feldolg vége
         SplitPath, A_LoopField, FName, FDir, FExt, FNameNoExt, FDrive

         If ShowIcons
         {
            ;IfInString,FDrive,://
            IfEqual,FExt,
            {
               IL_Add(ImageListID1,A_ProgramFiles "\Mozilla Firefox\firefox.exe",2)
               ;FExt := "FFurl"
            }
            else IfEqual,FExt,url
            {
               IL_Add(ImageListID1,A_ProgramFiles "\Internet Explorer\iexplore.exe",2)
            }
            else IfNotEqual,FDrive,c:
            {
               IL_Add(ImageListID1,"Shell32.dll",86) ;or 11
            }
            else ;If (not NetWorkIndex)
            {
               If FExt in exe,ico,bmp,lnk
               {
                  ;IfEqual, FExt, lnk
                     ;FileGetShortcut, %A_LoopField%, CurrItem
                  hIcon := DllCall("Shell32\ExtractAssociatedIconA", UInt, 0, Str, CurrItem, UShortP, iIndex)
                  ;Icon%FExt% := hIcon
               }
               else IfEqual,Icon%FExt%,
               {
                  hIcon := DllCall("Shell32\ExtractAssociatedIconA", UInt, 0, Str, A_LoopField, UShortP, iIndex)
                  Icon%FExt% := hIcon
               }
               else
               {
                  hIcon := Icon%FExt%
               }
               DllCall("ImageList_ReplaceIcon", UInt, ImageListID1, Int, -1, UInt, hIcon)
               ;DllCall("DestroyIcon", Uint, hIcon)
            }
         }

         LV_Add("Icon" Count, FNameNoExt, FExt, FDir )
      }

      IfEqual, Count,
         LV_Delete()
   }

   ControlGetText, CurrText, Edit1, %MainWnd%
   IfNotEqual, CurrText, %LastText%, Goto, GetText
   
   ;post results
   Results := LV_GetCount() . moreth

   ElapsedTime := (A_TickCount - StartTime)/1000
   Fstop := round(ElapsedTime,2)

   GuiControl,, Results, %Results% results (%Fstop% sec)
   LV_ModifyCol()

   ;select first item
   ControlSend, SysListView321, {Down}, %MainWnd%
Return

ScanNetwork:
   ;Run, %A_ScriptDir%\NetIndex320MPH.ahk
   ScanNetwork = 1
   ListFile_save = %ListFile%
   ListFile = Net%ListFile%
   PathListX_save := PathListX
   PathListX =
   ScanFirefox_save := ScanFirefox
   ScanFirefox =
   DriveGet,NetDrives,List,NETWORK
   Loop, Parse, NetDrives
      PathListX = %PathListX%%A_LoopField%:\|
   PathListX := SubStr(PathListX,1,-1)
   InputBox, PathListX, Network drives, Edit your network drives/folders to scan`nSeparated by pipe(|),,,,,,,,% PathListX
   If (not ERRORLEVEL and PathListX)
      GoSub, ButtonScan ;based on PathListX
   PathListX := PathListX_save
   ListFile = %ListFile_save%
   ScanFirefox := ScanFirefox_save
   ScanNetwork =
Return

ButtonScan:
;Gosub, Hide320
Menu, Tray, Icon, Shell32.dll, 46 ;23 57 172 210


Sleep, 500
SetTimer, DoScan, OFF
SetTimer, CheckScanPause, 500
FileDelete, %A_ScriptDir%\Scan%ListFile%

StringReplace,TypeList,TypeList,|,`,,All
StringReplace,ExcludeList,ExcludeList,|,`,,All
StringReplace,IncludeList,IncludeList,|,`,,All

   ;generating file list
   Loop, Parse, PathListX, |
   {
     DirToScan = %A_LoopField%
     If (SubStr(DirToScan,0)<>"\")
      DirToScan = %DirToScan%\
      IfNotExist, %DirToScan%
     {
        MsgBox, Not exist:%DirToScan%`nScanning continues with the next item.
        Continue
     }
     ;SplashImage,, %Spl_Design%,%DirToScan%,Scanning folders...

      ;Skip scanning Favorites if url is not to be indexed
      If DirToScan contains Favorites
        If Typelist not contains url,***
          Continue

      Loop, %DirToScan%*.*, 0, 1
      {
       If TypeList not contains ***
         If A_LoopFileExt not in %TypeList%
            Continue

         ;excluding items based on ExcludeList
         Cont = 0

       If A_LoopFileFullPath contains %ExcludeList%
         Cont = 1

         ;including items based on IncludeList
       If A_LoopFileFullPath contains %IncludeList%
         Cont = 0
      

         IfEqual, Cont, 1
            Continue

         ;reaching here means that file is not to be excluded and
         ;has a desired extension

         FileAppend, %A_LoopFileTimeModified%`t%A_LoopFileFullPath%`n, %A_ScriptDir%\Scan%ListFile%
      }
   }

   ScanItemList =

;--sort by mod-date------------------------------------------------------
   ;SplashImage,, %Spl_Design%,Sorting by mod date,Scanning folders...
   Loop, Read, %A_ScriptDir%\Scan%ListFile%
   {
      IfEqual, A_LoopReadLine,, Continue
      ScanItemList = %ScanItemList%%A_LoopReadLine%`n
   }

   Sort, ScanItemList, R ;Reverse sort
   FileDelete, %A_ScriptDir%\Scan%ListFile%
   RenRetry =
ButtonScan_DelRetry:
   ERRORLEVEL =
   FileMove,%A_ScriptDir%\Scan%ListFile%,%A_ScriptDir%\%ListFile%,1
   if ERRORLEVEL
   {
      RenRetry ++
      Sleep, 1000
      ;SplashImage,, %Spl_Design%,Retrying %RenRetry% of 10,Scan file rename error...
      If (RenRetry < 11)
         GoTo, ButtonScan_DelRetry
      SetTimer, RemoveTrT, 100
      MsgBox, Scan Error: The Scan_index file could not be renamed.`n%A_ScriptDir%\Scan%ListFile%. `nScanned results are not updated.
      ;Critical, OFF
      SetTimer, DoScan, %ScanCheckTimerInt%
      Menu, Tray, Icon, Shell32.dll, 23 ;23 57 172 210
      Return
   }

   ;SplashImage,, %Spl_Design%,Rewriting sorted items,Scanning folders...
   Loop, parse, ScanItemList, `n
   {
    IfEqual,A_LoopField,, Continue ; Omit the last linefeed (blank item) at the end of the list.
    StringSplit, FileItem, A_LoopField, %A_Tab%  ; Split into two parts at the tab char.
    FileAppend, %FileItem2%`n, %A_ScriptDir%\Scan%ListFile%
   }

   ScanItemList =
;--sort by mod-date vége-------------------------------------------------

   ;SplashImage,, %Spl_Design%,Reading bookmarks,Scanning Firefox BookMarks...
   If ScanFirefox
      GoSub, ScanFirefoxBM

   Sleep, 1000
   RenRetry =
ButtonScan_RenameRetry:
   ERRORLEVEL =
   FileMove,%A_ScriptDir%\Scan%ListFile%,%A_ScriptDir%\%ListFile%,1
   if ERRORLEVEL
   {
      RenRetry ++
      Sleep, 1000
      ;SplashImage,, %Spl_Design%,Retrying %RenRetry% of 10,Scan file rename error...
      If (RenRetry < 11)
         GoTo, ButtonScan_RenameRetry
      SetTimer, RemoveTrT, 100
      MsgBox, Scan Error: The Scan_index file could not be renamed.`n%A_ScriptDir%\Scan%ListFile%. `nScanned results are not updated.
      ;Critical, OFF
      SetTimer, DoScan, %ScanCheckTimerInt%
      Menu, Tray, Icon, Shell32.dll, 23 ;23 57 172 210
      Return
   }
   Sleep, 1000

   ;SplashImage,, %Spl_Design%,Reading in new items,Scanning folders...
   GoSub, ReadScanFile
   LastText =
   ;;SplashImage,, %Spl_Design%,,Scanning ready.
   ;SetTimer, RemoveTrT, 3000
SetTimer, CheckScanPause, OFF
;Critical, OFF
SetTimer, DoScan, %ScanCheckTimerInt%
Menu, Tray, Icon, Shell32.dll, 23 ;23 57 172 210
Return


CheckScanPause:
   If (A_TimeIdle > 499)
      Return
   Critical
   Menu, Tray, Icon, Shell32.dll, 21 ;23 57 172 210
   ;;SplashImage,2:, %Spl_Design%,Computer in use.`nWaiting %ScanPause% sec.,Scanning paused
   ;TrayTip,Scanning paused,Computer in use.`nWaiting %ScanPause% sec.,,1
   Sleep, % (ScanPause * 1000)
   ;;SplashImage,2:OFF
   ;TrayTip
   Menu, Tray, Icon, Shell32.dll, 46 ;23 57 172 210
   Critical, OFF
Return

ButtonOpen:
   ControlGetFocus, curFoc, %MainWnd%
   IfEqual, curFoc, Edit2
   {
   ControlFocus, Edit1, %MainWnd%
   Return
   }
   Gui, Submit, NoHide
   GetKeyState, ShKey, Shift
   GetKeyState, CtKey, Control
   GetKeyState, WinKey, LWin
   ControlFocus, SysListView321, %MainWnd%

   SelItem := LV_GetNext()

   IfEqual, SelItem, 0
      RunSearch = 1

   IfEqual, CtKey, D
      RunSearch = 1

   IfEqual, RunSearch, 1
   {
      RunItem = %CurrText%

      ;run unrecognised cmd
      IfNotExist, %CurrText%
      {
         FileExist = 0
         MsgBox, Goto`, AddToList
      }
   }

   ;running a found file/folder

   IfNotEqual, RunSearch, 1
   LV_GetText(FName, SelItem, 1)
   LV_GetText(FExt, SelItem, 2)
   LV_GetText(FDir, SelItem, 3)

   IfInString,FDir,://
    RunItem = %FDir%
   else IfEqual, FExt,
    RunItem = %FDir%\%FName%
   IfNotEqual, FExt,
    RunItem = %FDir%\%FName%.%FExt%
   FileExist = 1


   ;remove the last \ from a launched folder's name
   StringRight, check, RunItem, 1
   IfEqual, check, \
      StringTrimRight, RunItem, RunItem, 1

   ;add the \ back if the target is a drive path
   StringLen, check, RunItem
   IfLess, check, 3
      RunItem = %RunItem%\

IfInString,RunItem,://
{
   FFurl = 1
   Add2History = %RunItem%#%FName%
}
else
{
   FFurl =
   Add2History = %RunItem%
}

   ;File info box
   If (nyomi2 = 1 or WinKey = "D")
   {
      FileGetShortcut, %RunItem%, LnkTarget
      MsgBox RunItem = %RunItem% `n`nLnkTarget = %LnkTarget%
      Return
   }

   ;get real file path from shortcut
   StringRight, check, RunItem, 4
   if (InStr(check,".lnk"))
   {
     if LnkDir
     {
        FileGetShortcut, %RunItem%, LnkTarget
        IfNotInString, LnkTarget, {
          IfNotInString, LnkTarget, }
            RunItem = %LnkTarget%
     }
   }


   ;SplitPath, RunItem, FName, FDir, FExt, FNameNoExt, FDrive

   ;shift key down opens host folder
   ;Dir button opens host folder
   If (nyomi = 1 or ShKey = "D")
   If not FFurl
   {
     Run, Explorer /select`,"%RunItem%",, UseErrorLevel
      ;Run, %OpenFolderWithX% "%FDir%"
      GoSub, Hide320
      Return

   }
   else
   {
      GoSub, Hide320
      Return
   }

   ;simple run
   IfEqual, RParam,
      Run, %RunItem%, %FDir%, UseErrorLevel

   ;runtime param
   IfNotEqual, RParam,
      Run, %RunItem% "%RParam%", %FDir%, UseErrorLevel

AddToList:
If Add2History
{
   StringReplace, UsedList, UsedList, |%Add2History%,, A
   UsedList = |%Add2History%%UsedList%

   ;leave only max items in list
   ;StringReplace,UsedList,UsedList,||,|,All
   StringTrimLeft, UsedList, UsedList, 1
   StringSplit, UsedItem, UsedList, |
   UsedList =
   ulnum = 0
   ;Loop, % MaxLastUsed
   Loop, % UsedItem0
   {
      CurrItem := UsedItem%A_Index%
      IfEqual, CurrItem,, Continue
      UsedList = %UsedList%|%CurrItem%
     ulnum ++
     If (ulnum >= MaxLastUsed)
      Break
   }
   IniWrite, %UsedList%, %IniFile%, Advanced, UsedList
}
GoSub, Hide320
Return
;;End ButtonOpen


Selection:
  ControlGet, ShowTTip, Checked,, Button3, %MainWnd% ;A ShowTTip checkbox állapota
  GetKeyState, Esckey, Esc
  IfEqual, Esckey, D
    Return

  SelItem := LV_GetNext()
  LV_GetText(0FName, SelItem, 1)
  LV_GetText(0FExt, SelItem, 2)
  LV_GetText(0FDir, SelItem, 3)
   IfInString,0FDir,://
      Pth = %0FDir% [%0FName%]
   else
      Pth = %0FDir%\%0FName%.%0FExt%

  FTarget =

  If Pth
  {
    if (InStr(0FExt,"lnk"))
    {
      FileGetShortcut, %Pth%, FTarget
      SplitPath, FTarget, mFName, mFDir, mFExt,, mFDrive
    }
    else
      SplitPath, Pth, mFName, mFDir, mFExt,, mFDrive


   If mFExt in jpg,gif,bmp,png,tif,ico,wmf,emf,exif,ani,cur ;Other images in Gui
    {
      IfInString,mFDir,c:\ ;not NetWorkIndex
      If (FileExist(Pth))
      {
         WinMove,%MainWnd%,,%GuiX%,%GuiY%,% GuiW + 210,%GuiH% ;Make Gui bigger
         shPng := true
         ; If shIE
            ; IE_Move(pwb, GuiW, GuiMargin+40, 0, 0)
         GuiControl,, Static3, *w0 *h0 %Pth%
         GuiControl,MoveDraw, Static5, % "X" GuiW " Y" GuiMargin+45 " w200 h20"
         GuiControlGet, Pic, Pos, Static3
         GuiControl,, Static5,Picture preview: (%PicW% x %PicH%)
         ;The position/size will be stored in PicX, PicY, PicW, and PicH
         If (PicW > 200)
            GuiControl,, Static3, *w200 *h-1 %Pth%
      }
    }
   ; else If mFExt in ppt,pps,pot ;doc,xls ;IE preview
    ; {
      ; WinMove,%MainWnd%,,%GuiX%,%GuiY%,% GuiW + 210,%GuiH% ;Make Gui bigger
      ; shIE := true
         ; GuiControl,MoveDraw, Static3, w0 h0
      ; If (IE_Busy(pwb))
      ; {
         ; IE_Stop(pwb)
         ; Sleep,1000
      ; }
      ; If (not IE_Busy(pwb))
         ; IE_LoadURL(pwb,Pth)
      ; GuiControl,MoveDraw, Static5, % "X" GuiW " Y" GuiMargin+20 " w200 h20"
      ; GuiControl,, Static5,Preview
      ; ControlFocus,Edit1,%MainWnd%
    ; }
    else if (shPng or shIE)
   {
        WinMove,%MainWnd%,,%GuiX%,%GuiY%,%GuiW%,%GuiH% ;Restore Gui size
      shPng =
      shIE =
   }
  }


  if (Pth && ShowTTip)
  {
    if (InStr(0FExt,"lnk"))
    {
       FileGetTime, FileDate, %FTarget%, M  ; Retrieves the modification time by default.
    }
    else
    {
       FileGetTime, FileDate, %Pth%, M  ; Retrieves the modification time by default.
    }
    FormatTime, FileDate, %FileDate%, yyyy.MM.dd HH:mm
    ToShow = File:`t%Pth%`nTarget:`t%FTarget%`nModif:`t%FileDate%
    If not wH
      WinGetPos, wX, wY, wW, wH, %MainWnd%
    ;ToolTip, %ToShow%, %wW%, 3 ;jobboldalt felül
    ToolTip, %ToShow%, 0, %wH% ;alul
  }

  IfEqual, A_GuiControlEvent, DoubleClick
    GoTo, ButtonOpen
Return



Google:
   doma = com
   If (A_Language = "040e")
      doma = hu
   ControlGetText,Txt,Edit1,%MainWnd%
   Run, www.google.%doma%/search?q=%Txt%
Return

Wikipedia:
   doma = en
   If (A_Language = "040e")
      doma = hu
   ControlGetText,Txt,Edit1,%MainWnd%
   Run, http://%doma%.wikipedia.org/?search=%Txt%
Return

ButtonDir:
  nyomi = 1
  GoSub, ButtonOpen
  nyomi =
Return

ButtonDirTg:
  LnkDir = 1
  nyomi = 1
  GoSub, ButtonOpen
  LnkDir =
  nyomi =
Return

MenuWin:
  nyomi2 = 1
  GoSub, ButtonOpen
  nyomi2 =
Return

GuiEscape:
  GoSub, Hide320
Return

GuiClose:
  GoSub, Hide320
Return

GuiMove:
   Critical
   PostMessage, 0xA1, 2,,, A
   Sleep, 200
   ; WinGetPos, aGX, aGY,,, ahk_id %mgH%
   ; If (aGX < 0 or aGY < 0)
   ; {
      ; IniRead, aGX, %IniFile%, Settings, GuiX
      ; IniRead, aGY, %IniFile%, Settings, GuiY
   ; }
   ; IniWrite, %aGX%, %IniFile%, Settings, GuiX
   ; IniWrite, %aGY%, %IniFile%, Settings, GuiY
   Critical, Off
Return


;Chris made this long ago!
ExpandVars(Var)
{
   var_new = %var%
   in_reference = n
   Loop, parse, var_new, `%
   {
      if in_reference = n
      {
         in_reference = y
         continue
      }
      StringTrimLeft, ref_contents, %A_LoopField%, 0
      StringReplace, var_new, var_new, `%%A_LoopField%`%, %ref_contents%, all
      in_reference = n
   }
   Return, var_new
}



Hide320:
  ControlFocus, SysListView321, %MainWnd% ;removes long name tooltip
   If shPng
     WinMove,%MainWnd%,,%GuiX%,%GuiY%,%GuiW%,%GuiH%

   ControlGetText, zz, Edit1, %MainWnd%

   if id320 <> -1
   {
      WinHide, ahk_id %id320%
      ;ToolTip
      ;GoSub, Start320
   }
   ToolTip
Return

Show320:
   if id320 <> -1
   {
      WinShow, ahk_id %id320%
      WinActivate, ahk_id %id320%
      ControlFocus, Edit1, ahk_id %id320%
      ;Reload ItemList
      GoSub, ReadScanFile
   }
   if (zz)
     ControlSetText,Edit1,%zz%,ahk_id %id320%
   Send, ^a ;select all
Return

Up::
Down::
PgUp::
PgDn::
Home::
End::
   IfWinNotActive, %MainWnd%
   {
      Send, {%A_ThisHotkey%}
      Return
   }
   ControlGetFocus, CurrCtrl, %MainWnd%
   IfEqual, CurrCtrl, Edit1
      ControlSend, SysListView321, {%A_ThisHotkey%}, %MainWnd%
   else
    send, {%A_ThisHotkey%}
Return


AppsKey::
  IfWinNotActive, %MainWnd%
     {
        Send, {AppsKey}
        Return
     }
GuiContextMenu:  ; Launched in response to a right-click or press of the Apps key.
  Hotkey, Up, Off
  Hotkey, Down, Off
  GoSub, CheckScanDate_and_CreateMenus
  Menu, MyContextMenu, Show , 220, 100 ;%A_GuiX%, %A_GuiY%
  Hotkey, Up, On
  Hotkey, Down, On
return

~!f::
   ;Alt-F Toggle FindInPath checkbox
   IfWinNotActive, %MainWnd%
     Return
   ControlClick, Button2, %MainWnd%
   ;A FindInPath checkbox állapota
   ControlGet, FindInPath, Checked,, Button2, %MainWnd%
   IniWrite, %FindInPath%, %IniFile%, Display, FindInPath
   ControlFocus, Edit1, %MainWnd%
   GoTo, GetText
Return

~!s::
   ;Alt-S Edit MaxItems
   IfWinNotActive, %MainWnd%
     Return
   ControlGetFocus, curFoc, %MainWnd%
   IfEqual, curFoc, Edit2
   {
      ControlFocus, Edit1, %MainWnd%
      GoTo, GetText
   }
   else
   {
      ControlFocus, Edit2, %MainWnd%
      Send, {Control Down}a{Control Up}
   }
Return

~!t::
   ;Alt-T Toggle ShowTTip checkbox
   IfWinNotActive, %MainWnd%
     Return
   ControlClick, Button3, %MainWnd%
   ;A ShowTTip checkbox állapota
   ControlGet, ShowTTip, Checked,, Button3, %MainWnd%
   IniWrite, %ShowTTip%, %IniFile%, Display, ShowTTip
   if !ShowTTip
     Tooltip
   ControlFocus, Edit1, %MainWnd%
   GoTo, GetText
Return

UPDATEDSCRIPT:
FileGetAttrib,attribs,%A_ScriptFullPath%
IfInString,attribs,A
{
  FileSetAttrib,-A,%A_ScriptFullPath%
  ;SplashImage,,%Spl_Design%,Reloaded,%A_ScriptName%
  Sleep,1000
  ;SplashImage, OFF
  Reload
}
Return

ChangeView:
;!v::
   IfWinNotActive, %MainWnd%,, Return
   IfEqual, CurrentView, ;LargeIcons
   {
      ;Make it Report
      IconSize = 0
      sGuiW := GuiW
      sGuiH := GuiH
      sGuiX := GuiX
      GuiW := GuiW + 500
      GuiH := GuiH
      GuiX := GuiX - 250
      WinMove,%MainWnd%,,%GuiX%,%GuiY%,%GuiW%,%GuiH% ;Make Gui restored
      Gui, Font, s8, Tahoma
      GuiControl, Font, SysListView321
      GuiControl, MoveDraw, SysListView321, % "w" LVGuiW+500
      GuiControl, +Report, SysListView321
      GuiControl, +BackgroundWhite +CBlack, SysListView321
      GuiControl, MoveDraw, Static3, % "x" GuiW
      LV_ModifyCol()
      CurrentView = Report
      IniWrite, 1, %IniFile%, Display, ShowBigView
   }
   else
   {
      ;Make it Tile
      IconSize = 1
      GuiW := sGuiW
      GuiH := sGuiH
      GuiX := sGuiX
      WinMove,%MainWnd%,,%GuiX%,%GuiY%,%GuiW%,%GuiH% ;Make Gui restored
      Gui, Font, s9, %GuiFont%
      GuiControl, Font, SysListView321
      GuiControl, MoveDraw, SysListView321, % "w" LVGuiW
      GuiControl, +Tile, SysListView321
      GuiControl, +BackgroundBlack +CWhite, SysListView321
      GuiControl, MoveDraw, Static3, % "x" GuiW
      LV_ModifyCol()
      CurrentView =
      IniWrite, 0, %IniFile%, Display, ShowBigView
   }
   GuiControl, Move, MOVER, w%GuiW% h%GuiH%
   LastText = lskldjfiwjesakjdwoidj
   GoSub, GetText
Return

^Del::
MenuDel:
   IfWinNotActive, %MainWnd%,, Return
   ControlGetText, CurrText, Edit1, %MainWnd%
   IfNotEqual, CurrText,, Return

   SelItem := LV_GetNext()
   LV_GetText(FName, SelItem, 1)
   LV_GetText(FExt, SelItem, 2)
   LV_GetText(FDir, SelItem, 3)

  IfEqual, FExt,
   IfNotInString,FDir,://
    Pth = %FDir%\%FName%
   else
    Pth = %FDir%#%FName%
  IfNotEqual, FExt,
    Pth = %FDir%\%FName%.%FExt%
   StringReplace, UsedList, UsedList, |%pth%,, A
   IniWrite, %UsedList%, %IniFile%, Advanced, UsedList
   LastText = xkhdkhsaoihdiiouwoeiue
   Goto, GetText
Return

;; Configure here your quick-access-key ;;

CapsLock & a::
!d::
   IFWinExist, ahk_id %id320%
   {
      GoSub, Hide320
      Return
   }
   DetectHiddenWindows, ON
   IFWinExist, ahk_id %id320%
      GoSub, Show320
   DetectHiddenWindows, OFF
Return

!^d::
   ExitApp
Return

;; Control the focus of main window. When it lose focus, hide it.
WM_ACTIVATE( wParam, lParam )
{
   if ( wParam = 0 )
      GoSub Hide320
   Return 0
}


ScanFirefoxBM:
IfNotExist, %A_AppData%\Mozilla\Firefox\profiles.ini
{
   MsgBox, Does not exist %A_AppData%\Mozilla\Firefox\profiles.ini
   Return
}

;get path to bookmarks file
Loop
{
   ;don't scan for more than 25 profiles to prevent un-ending loop
   IfGreater, A_Index, 25, Break

   Count := A_Index - 1
   ;see if current profile is Default
   IniRead, IsDefault, %A_AppData%\Mozilla\Firefox\profiles.ini, Profile%Count%, Default, %A_Space%
   IfEqual, IsDefault,
   IniRead, IsDefault, %A_AppData%\Mozilla\Firefox\profiles.ini, Profile%Count%, Name, %A_Space%
   Else
   IsDefault = default
   IfEqual, IsDefault, default
   {
      ;get path to default profile
      IniRead, PPath, %A_AppData%\Mozilla\Firefox\profiles.ini, Profile%Count%, Path, %A_Space%

      ;check for bookmarks file
      IfExist, %PPath%\bookmarks.html
         BMFile = %PPath%\bookmarks.html
      Else IfExist, %A_AppData%\Mozilla\Firefox\%PPath%
         BMFile = %A_AppData%\Mozilla\Firefox\%PPath%\bookmarks.html
      Else
      {
         ;read last saved bookmarks file path
         IniRead, BMFile, %A_ScriptFullPath%, Plugin Settings, Bookmarks, %A_Space%
         IfNotExist, %BMFile%
         {
            MsgBox,, 320MPH Firefox Bookmarks plugin, FireFox Bookmarks file not found.`nIn the next window, please select the file from Firefox Profile folder.
            FileSelectFile, BMFile, 3, bookmarks.html, Select FireFox Bookmarks file, HTML Documents (*.html)

            IfNotExist, %BMFile%
               Return
         If not A_IsCompiled
            IniWrite, %BMFile%, %A_ScriptFullPath%, Plugin Settings, Bookmarks
         }
      }
      Break
   }
}


;last resort -> use profile0
IfEqual, BMFile,
IfExist, %A_AppData%\Mozilla\Firefox\profiles.ini
{
  IniRead, PPath, %A_AppData%\Mozilla\Firefox\profiles.ini, Profile%Count%, Path, %A_Space%

  ;check for bookmarks file
  IfExist, %PPath%\bookmarks.html
     BMFile = %PPath%\bookmarks.html
  Else IfExist, %A_AppData%\Mozilla\Firefox\%PPath%
     BMFile = %A_AppData%\Mozilla\Firefox\%PPath%\bookmarks.html
}

;give up finally
IfNotExist, %BMFile%
   Return


FileRead, BookMarks, %BMFile%

Sclp := ClipboardAll
List2Write =
Loop, Parse, BookMarks, `n, `r
{
   RE = U)\QHREF="\E.*"
   RegExMatch(A_LoopField, RE, ToRun)
   IfEqual, ToRun,, Continue

   StringTrimLeft, ToRun, ToRun, 6
   StringTrimRight, ToRun, ToRun, 1

   RE = U)">.*\Q</A>\E
   FixHighligthing = "
   RegExMatch(A_LoopField, RE, Tags)
   IfEqual, Tags,, Continue
   StringTrimLeft, Tags, Tags, 2
   StringTrimRight, Tags, Tags, 4

;________________________________________________________
   ;IMPORTANT for compatability reasons
   StringReplace, Tags, Tags, |, -, A
   StringReplace, Tags, Tags, #, -, A
;________________________________________________________


   Transform, Clipboard, Unicode, %Tags%
   Tags := Clipboard



;________________________________________________________
   ;APPEND additions to existing cache file
   ;eg.
   ;C:\Folder\File.exe <Search Tags to help find this file>
   List2Write = %List2Write%`n<ToRun=%ToRun%><Name=%Tags%>
;________________________________________________________
}
Clipboard := Sclp
Sclp =

;FireFox in nDroid index file
StringReplace,List2Write,List2Write,<ToRun=,,All
StringReplace,List2Write,List2Write,<Name=,#,All ; = marad
StringReplace,List2Write,List2Write,>,,All

;________________________________________________________
;For all read/write actions to cache file DON'T provide path.
;Use as if the cache file is in plugin's folder.
FileAppend, %List2Write%, %A_ScriptDir%\Scan%ListFile%
;FileAppend, %List2Write%, %IndexFile%
;________________________________________________________
Return


;#Include %A_ScriptDir%\IEControl.ahk

;#Include %A_ScriptDir%\IniGui.ahk

IniGui_Setup:
   If (!IniGui_IniFile)
      Return
   IfNotExist,%IniGui_IniFile%
      Return
   IniGui_Hiba =
   
   Gui, 99:+LastFound
   IniGui_mywin := WinExist()
   Gui, 99:+Resize
   Gui, 99:Default
   Gui, 99:Add, TreeView, vIniGui_MyTree x0 y0 h500 w200 gIniGui_MyTree

   Gui, 99:Add, Text, w400 x210 y20 h105, ;Dummy for type description and Help
   Gui, Font, Bold
   Gui, 99:Add, Text, w400 x210 y130, Value:
   Gui, 99:Add, Text, w400 x210 y330, Default:
   Gui, Font

   Gui, 99:Add, Edit, w400 r10 x210 y150 -Wrap HScroll gIniGui_DoEdit1 vIniGui_Ed1,
   Gui, 99:Add, Edit, w200 r1 x210 y150 gIniGui_DoEdit2 vIniGui_Ed2,
   Gui, 99:Add, Checkbox, w400 x210 y150 gIniGui_DoButton1,

   Gui, 99:Add, Edit, w400 x210 y350 h100, ;Dummy for Default val text

   Gui, 99: Add, Button, x460 y460 w150 h25 gIniGui_DoExit, Close
   GoSub, IniGui_AddTreeItems

   Gui, 99:Show,w620 h500,%A_ScriptName% Setup
Return

IniGui_AddTreeItems:
   Loop, Read, %IniGui_IniFile%
   {
      If (!A_LoopReadLine or SubStr(A_LoopReadLine,1,1)=";")
         Continue
      If (SubStr(A_LoopReadLine,1,1)="[") ;Section
         If not IniGui_Expand
         {
            StringReplace,IniGui_Sect,A_LoopReadLine,[,,All
            StringReplace,IniGui_Sect,IniGui_Sect,],,All
            IniGui_SID := TV_Add(IniGui_Sect,"","Bold Expand")
            IniGui_Expand = 1
         }
         else
         {
            StringReplace,IniGui_Sect,A_LoopReadLine,[,,All
            StringReplace,IniGui_Sect,IniGui_Sect,],,All
            IniGui_SID := TV_Add(IniGui_Sect,"","Bold")
         }
      else ;Param
      {
         StringSplit,IniGui_Item,A_LoopReadLine,=
         IniGui_Par = %IniGui_Item1%
         IniGui_IID := TV_Add(IniGui_Par,IniGui_SID)
      }
   }
Return

IniGui_MyTree:  ; This subroutine handles user actions (such as clicking).
   if A_GuiEvent <> S  ; i.e. an event other than "select new tree item".
       Return  ; Do nothing.
   
Critical
   IniGui_CurrTV := A_EventInfo
   TV_GetText(IniGui_ValName,IniGui_CurrTV)
   IniGui_PID := TV_GetParent(IniGui_CurrTV)
   TV_GetText(IniGui_PName,IniGui_PID)
   IniRead,IniGui_Val,%IniGui_IniFile%,%IniGui_PName%,%IniGui_ValName%
   ;Tooltip, IniRead IniGui_Val "IniGui_IniFile" %IniGui_PName% %IniGui_ValName%
   
   ;Get Help and Default if any
   IniGui_Help = `r`n
   IniGui_Default =
   IniGui_Type =
   IniGui_Kell =
   Loop, Read, %IniGui_IniFile%
   {
;IfNotEqual, A_EventInfo, %IniGui_CurrTV%, GoTo, IniGui_MyTree
      ;IfNotInString,A_LoopReadLine,%IniGui_ValName%
      If (SubStr(A_LoopReadLine,1,StrLen(IniGui_ValName))<>IniGui_ValName)
      {
         If not IniGui_Kell
            Continue
      }
      else
      {
         IniGui_Kell = 1
         Continue
      }
      ;MsgBox, %A_LoopReadLine%
      If (SubStr(A_LoopReadLine,1,8)=";default") ;Default
         IniGui_Default := SubStr(A_LoopReadLine,InStr(A_LoopReadLine,"=")+1)
      else If (SubStr(A_LoopReadLine,1,5)=";type") ;Type
         IniGui_Type := SubStr(A_LoopReadLine,InStr(A_LoopReadLine,"=")+1)
      else If (SubStr(A_LoopReadLine,1,1)=";") ;Help
         IniGui_Help := IniGui_Help . "`r`n" . SubStr(A_LoopReadLine,2)
      else If (!A_LoopReadLine) ;Empty row
         Continue
      else ;New section or Param
         Break
      Continue
   }

   
   Control,Hide,,Static1,ahk_id %IniGui_mywin%
   Control,Hide,,Static2,ahk_id %IniGui_mywin%
   Control,Hide,,Static3,ahk_id %IniGui_mywin%
   Control,Hide,,Edit1,ahk_id %IniGui_mywin%
   Control,Hide,,Edit2,ahk_id %IniGui_mywin%
   Control,Hide,,Edit3,ahk_id %IniGui_mywin%
   Control,Hide,,Button1,ahk_id %IniGui_mywin%
   If (IniGui_Val=="" or IniGui_Val="ERROR")
      Return
   ; StringReplace,IniGui_Help,IniGui_Help,|,`r`n,All
   ; StringReplace,IniGui_Default,IniGui_Default,|,`r`n,All
   Control,Show,,Static1,ahk_id %IniGui_mywin%
   Control,Show,,Static2,ahk_id %IniGui_mywin%

;IfNotEqual, A_EventInfo, %IniGui_CurrTV%, GoTo, IniGui_MyTree

   ;If IniGui_Val in false,true ;Boolean
   If (InStr(IniGui_Type,"bool")) ;Boolean
   {
      ControlSetText,Static1,%IniGui_ValName% (type: Boolean) %IniGui_Help%
      If IniGui_Default
      {
         Control,Show,,Edit3,ahk_id %IniGui_mywin%
         Control,Show,,Static3,ahk_id %IniGui_mywin%
         ControlSetText,Edit3,%IniGui_Default%
      }
      Control,Show,,Button1,ahk_id %IniGui_mywin%
      If (IniGui_Val)
         Control,Check,,Button1,ahk_id %IniGui_mywin%
      else
         Control,UnCheck,,Button1,ahk_id %IniGui_mywin%
      ControlFocus,SysTreeView321,ahk_id %IniGui_mywin%
   }

   else If (InStr(IniGui_Type,"parse") or (InStr(IniGui_Val,"|") and StrLen(IniGui_Val)>1)) ;Parse list
   {
      ControlSetText,Static1,%IniGui_ValName% (type: Parse List) %IniGui_Help%
      If IniGui_Default
      {
         Control,Show,,Edit3,ahk_id %IniGui_mywin%
         Control,Show,,Static3,ahk_id %IniGui_mywin%
         StringReplace,IniGui_Default,IniGui_Default,|,`r`n,All
         ControlSetText,Edit3,%IniGui_Default%
      }
      Control,Show,,Edit1,ahk_id %IniGui_mywin%
      StringReplace,IniGui_Val,IniGui_Val,|,`r`n,All
      ControlSetText,Edit1,% IniGui_Val,ahk_id %IniGui_mywin%
   }

   else If (StrLen(IniGui_Val)<30) ;Short text
   {
      ControlSetText,Static1,%IniGui_ValName% (type: Short Text or Num) %IniGui_Help%
      If IniGui_Default
      {
         Control,Show,,Edit3,ahk_id %IniGui_mywin%
         Control,Show,,Static3,ahk_id %IniGui_mywin%
         ControlSetText,Edit3,%IniGui_Default%
      }
      Control,Show,,Edit2,ahk_id %IniGui_mywin%
      ControlSetText,Edit2,% IniGui_Val,ahk_id %IniGui_mywin%
   }

   else ;Long text noWrap
   {
      ControlSetText,Static1,%IniGui_ValName% (type: Long Text) %IniGui_Help%
      If IniGui_Default
      {
         Control,Show,,Edit3,ahk_id %IniGui_mywin%
         Control,Show,,Static3,ahk_id %IniGui_mywin%
         ControlSetText,Edit3,%IniGui_Default%
      }
      Control,Show,,Edit1,ahk_id %IniGui_mywin%
      ControlSetText,Edit1,% IniGui_Val,ahk_id %IniGui_mywin%
   }
;IfNotEqual, A_EventInfo, %IniGui_CurrTV%, GoTo, IniGui_MyTree
Critical, Off
Return

IniGui_DoWriteIni(IniGui_CurrTV,IniGui_Val)
{
Global
   IniGui_ID := TV_GetText(IniGui_Par,IniGui_CurrTV)
   IniGui_PID := TV_GetParent(IniGui_ID)
   TV_GetText(IniGui_PName,IniGui_PID)
   ;Tooltip, % "IniWrite: " IniGui_Par "=" IniGui_Val " Section:" IniGui_PName
   IniWrite, %IniGui_Val%, %IniGui_IniFile%, %IniGui_PName%, %IniGui_Par%
Return
}

IniGui_DoEdit1:
   ControlGetText,IniGui_Ed1,Edit1,ahk_id %IniGui_mywin%
   StringReplace,IniGui_Val,IniGui_Ed1,`r`n,|,All
   StringReplace,IniGui_Val,IniGui_Val,||,|,All
   StringReplace,IniGui_Val,IniGui_Val,||,|,All
   StringReplace,IniGui_Val,IniGui_Val,||,|,All
   IniGui_DoWriteIni(IniGui_CurrTV,IniGui_Val)
Return

IniGui_DoEdit2:
   ControlGetText,IniGui_Ed2,Edit2,ahk_id %IniGui_mywin%
   IniGui_Val := IniGui_Ed2
   IniGui_DoWriteIni(IniGui_CurrTV,IniGui_Val)
Return

IniGui_DoButton1:
   ControlGet, IniGui_Bu1, Checked,, Button1, ahk_id %IniGui_mywin%
   IniGui_Val = 0
   If IniGui_Bu1
      IniGui_Val = 1
   IniGui_DoWriteIni(IniGui_CurrTV,IniGui_Val)
Return

IniGui_DoExit:
99GuiClose:
99GuiEscape:
   Gui, 99:Destroy
   Gui, 1:Default
   Tooltip
   GoSub, IniGui_Load
Return

IniGui_Load:
   If (!IniGui_IniFile)
   {
      MsgBox, IniGui_IniFile is not defined.
      Return
   }
   IfNotExist,%IniGui_IniFile%
   {
      MsgBox, %IniGui_IniFile% not exists.
      Return
   }
   IniGui_Hiba =
   Loop, Read, %IniGui_IniFile%
   {
      If (!A_LoopReadLine or SubStr(A_LoopReadLine,1,1)=";")
         Continue
      If (SubStr(A_LoopReadLine,1,1)="[")
      {
         StringReplace,IniGui_Sect,A_LoopReadLine,[,,All
         StringReplace,IniGui_Sect,IniGui_Sect,],,All
      }
      else
      {
         StringSplit,IniGui_Item,A_LoopReadLine,=
         IniGui_Par = %IniGui_Item1%
         IniRead,%IniGui_Par%,%IniGui_IniFile%,%IniGui_Sect%,%IniGui_Par%
         ;MsgBox, IniRead-%IniGui_Item1%-%IniGui_IniFile%-%IniGui_Sect%-%IniGui_Item1%
      }
   }
Return


/*
********************************************************
         USER CONFIGURATION AREA

[Plugin Settings]
;FireFox Bookmarks path
Bookmarks=


********************************************************
*/





Best,
fures Laughing
Back to top
View user's profile Send private message
Hacker



Joined: 10 Jun 2006
Posts: 65
Location: Bratislava, Slovakia

PostPosted: Sun Apr 27, 2008 9:41 am    Post subject: Reply with quote

fures,
Does not seem to work quite right. Upon startup I get:
Code:
Not exist:C:\Documents and Settings\Hacker\Application Data\Microsoft\Sablonok\
Scanning continues with the next item.


Quote:
look into the options (right click or AppsKey) what you can setup.

Where? The script menu is the standard AutoHotkey script menu, no Options or Settings or similar. I do not even get any window opened upon startup, only the tray icon.

Roman
Back to top
View user's profile Send private message
Carlito
Guest





PostPosted: Sun Apr 27, 2008 11:20 am    Post subject: Reply with quote

fures, this has been already requested, could you please modify the script above to scan/display folders only?
Back to top
Carlito
Guest





PostPosted: Sun Apr 27, 2008 11:23 am    Post subject: Reply with quote

Hacker wrote:

Where? The script menu is the standard AutoHotkey script menu, no Options or Settings or similar. I do not even get any window opened upon startup, only the tray icon.
Roman

I guess you have to run one scan at least to have that option, I can right-click the tray icon and choose "Setup options".
Back to top
John_S
Guest





PostPosted: Mon Apr 28, 2008 12:54 pm    Post subject: Reply with quote

@ HugoV
I don't know if you could add the following to the Total Commander search script, that would be brilliant.
I'd like to have the script running all the time and not just on-demand ( Alt+F10 ) and to make it update its RunList4Folders.txt let's say every 15 min. The update function should be silent ( while in the systray for instance )
I might be wrong but using treeinfo.wc is not very reliable, RunList4Folders.txt is serving me well.
Thanks for your patience Smile
Back to top
fures



Joined: 31 Jan 2008
Posts: 23

PostPosted: Mon Apr 28, 2008 7:10 pm    Post subject: Reply with quote

Carlito wrote:
fures, this has been already requested, could you please modify the script above to scan/display folders only?


It's difficult to say no to such a polite request...

I've included handling of directories as a file type.
You have to put only "dir" into the TypeList of your ini file to scan and show only directories. Also, modify the PathList to where you want to search directories.

E.g.

PathList=C:/
TypeList=dir
ScanFirefox=0

will scan all your directories

enjoy.

Code:

;#NoTrayIcon
#SingleInstance FORCE
AutoTrim, Off
SetWorkingDir %A_ScriptDir%
SetBatchLines, -1
 OnMessage( 6, "WM_ACTIVATE" )
MainWnd = X_%A_ScriptName%
SetKeyDelay, 0
id320 = -1
;; ID of 320 MPH Screen
;___________________________________________
Process, Priority,, High
Menu, Tray, Icon, Shell32.dll, 23 ;23 57 172 210
Menu, Tray, Tip, %MainWnd%

SetTimer,UPDATEDSCRIPT,1000

   IniFile = %A_ScriptDir%\320MPHX.ini
   IniGui_IniFile:=IniFile
   
   IfNotExist, %IniFile%
      GoSub, WriteIni
   GoSub, ReadIni

IndexFile = %A_ScriptDir%\%ListFile%
   ;AlwaysScan := ExpandVars(AlwaysScanI)
   PathListX := ExpandVars(PathList)
   OpenFolderWithX := ExpandVars(OpenFolderWith)

Start320:
   StringRight, ExtChk, A_ScriptFullPath, 4
   IfEqual, ExtChk, .exe
      If ShellIntegration
      {
         RegWrite, REG_SZ, HKCR, *\Shell\320MPH\Command,, "%A_ScriptFullPath%" "`%1"
         RegWrite, REG_SZ, HKCR, Folder\shell\320MPH\command,, "%A_ScriptFullPath%" "`%1"
      }
      Else
      {
         RegDelete, HKCR, *\Shell\320MPH,
         RegDelete, HKCR, Folder\Shell\320MPH,
      }

   RParam = %1%

   ;create scanned result list on first run
   IfNotExist, %A_ScriptDir%\%ListFile%
   {
      SplashImage,, %Spl_Design2%,Please wait...,First time scanning your directories
      GoSub, ButtonScan
      SplashImage, OFF
   }

   ;Check scan date and create menus
   GoSub, CheckScanDate_and_CreateMenus


   ;;JWJ - Avoids drawing GUI again
   if id320 <> -1 ;not the 1st run
      Return

   ;///////////////////////////////////////////////////////////////////////////////////

   ;Read scan file in ItemList
   GoSub, ReadScanFile


   ;Make Gui
   GuiX := ;X0 !!!
   GuiY := ;Y26 !!!
   LVGuiW := 263 ;GuiW - 12
   GuiMargin := 15
   GuiH := 560

   GuiW := LVGuiW + (GuiMargin * 2) ;275 volt, 10 115 - 232 645
   LVGuiH := GuiH - GuiMargin - 48 - 20 - 20 - 5 ;64
   StatusY := GuiH -3 - 20 ;25
   Status2Y := GuiH -3 - 20 - 20 ;25
   FEditX := GuiW - GuiMargin - 150
   FEditTY := GuiMargin + 5
   IconSize := 1

   Gui, -Caption +Border +lastfound
   mgH := WinExist()
   Gui, Color, %GuiColor%

   gui, font, s10, %GuiFont%
   Gui, Add, Text, % "x" GuiMargin "y" FEditTY-10, Search:
   Gui, Add, Edit, % "x+15 y" GuiMargin-10 " w200 vCurrText gGetText",
   gui, font, s9, %GuiFont%
   Gui, Add, ListView, Tile x%GuiMargin% y+30 w%LVGuiW% h%LVGuiH% vSelItem gSelection AltSubmit BackgroundBlack CWhite, Name|Ext|Folder
   Gui, Font
   Gui, Add, Button,x0 y0 w0 h0
   Gui, Add, Text, % "x" GuiMargin+0 " y" GuiMargin+10 " w60 h28 vResults",
   Gui, Add, CheckBox, % "x" FEditX+77 " y" StatusY " vFindInPath Right w83", &Find in Path
   Gui, Add, CheckBox, % "x" FEditX+77 " y" Status2Y " vShowTTip Right w83", Show &Tooltip
   Gui, Add, Picture, % "X" GuiW " Y" GuiMargin+65 " W200 H480", %Pth%
   Gui, Add, Text, x%GuiMargin% y%Status2Y%, Max item&s:
   Gui, Add, Edit, x+2 y%Status2Y% w35 h16 vMaxIt gGetText, %MaxItems%
   Gui, Add, Button, % "x" GuiMargin " y" StatusY-2 " h21 gChangeView", Change &View
   Gui, Add, Text, % "X" GuiW " Y" GuiMargin+45 " w0 h0" ;placeholder for the picture preview data-text
   Gui, Add, Button, % "x" GuiMargin+61 " y" GuiMargin-10+30 " w50 h22 gButtonOpen Default", &Open
   Gui, Add, Button, % "x+5" " y" " h22 gButtonDir", &Dir Open
   Gui, Add, Button, % "x+5" " y" " h22 gButtonDirTg", Target-Dir Open
   Gui, Add, Button, % "x+15" " y" " h22 gGoogle", &Google Search
   Gui, Add, Button, % "x+5" " y" " h22 gWikipedia", &Wikipedia

   Gui, Add, Button, % "x" GuiMargin+80 " y" StatusY-2 " h21 gScanNetwork", Scan Network Now!
   Gui, Add, CheckBox, % "x" GuiMargin+90 " y" Status2Y " gAltIndexFile Right w100", &Network Search
   Gui, Add, Text, % "x" GuiW " y" GuiMargin-10+3+5 " h20", Run-Params:
   Gui, Add, Edit, x+5 yp-3 w100 h20 vRParam, %RParam%

   ;pwb := IE_Add(mgH, GuiW, GuiMargin+40, 200, 200)

   Gui, Add, Text,  x0 y0 w%GuiW% h%GuiH% cFFFFFF Backgroundtrans +0x200 gGuiMove vMOVER


   LV_ModifyCol (1, 210) ;100

   Gui, Show, h%GuiH% w%GuiW% %GuiX% %GuiY%, %MainWnd%
   WinGetPos, GuiX, GuiY,,,%MainWnd%

   WinGet, id320, ID, A
   If FindInPath
     Control,Check,,Button2,%MainWnd%
   If ShowTTip
     Control,Check,,Button3,%MainWnd%
   ControlFocus, Edit1, %MainWnd%

; Gui, 2:+lastfound
; mgHIE := WinExist()
; pwb := IE_Add(mgHIE, 0, 0, 400, 300)
; Gui, 2:Show, NoActivate Hide x10 y50 w400 h300, Preview IE


   LastText = fadsfSDFDFasdFdfsadfsadFDSFDf

   If ShowBigView
      GoSub, ChangeView

   Gosub, GetText
   Control, Choose, 1, SysListView321, %MainWnd%

   GoSub, DoScan


Return
;______END of AUTOEXECUTE section______________________


ReadIni:
   ;;SplashImage design attribs:
   Spl_Design = y30 x800 w150 M C11 ZH0 ZW0 ZX5 ZY5 B1 CT236782 CWffffcc FM7 FS7 WM600 WS400
   Spl_Design2 = M C11 ZH0 ZW0 ZX5 ZY5 B1 CT236782 CWffffcc FM11 FS11 WM600 WS400

   GoSub, IniGui_Load
Return

WriteIni:
   ;Creating ini File - if not any
   FileAppend,
(
[Scanning]
PathList=%A_MyDocuments%|%A_StartMenuCommon%|%A_StartMenu%|%A_Desktop%|%UserProfile%\Favorites|%A_ProgramFiles%
;List of paths to scan
;Default=%A_MyDocuments%|%A_StartMenuCommon%|%A_StartMenu%|%A_Desktop%|%UserProfile%\Favorites|%A_ProgramFiles%
TypeList=exe|lnk|ahk|doc|xls|ppt|pdf|dot|xlt|pot|jpg|jpeg|tif|ico|wmf|emf|exif|ani|cur|mpg|mpeg|avi|mov|wmv|asf|url|txt|ini|log|gif|png
;List of extensions to scan for
;Use *** for any extension (time consuming scan!)
ExcludeList=about|history|readme|remove|unins|license
;Strings to exclude from scanning
IncludeList=mustreadme|readmeanyway|zsoft
;Strings to still include, even if in exclude list
;Example: All "uninst" are excluded, but ZSoft Uninstaller is still in
ScanFirefox=1
;Do you want to scan Firefox Bookmarks?
;Type=boolean
ScanPause=5
;A running scan will pause for this many seconds when you use your computer
ScanPeriod=2
;in hours. Scan in background every X hours.
ListFile=RunList.lst
;Name of the main index file

[Display]
ShowIcons=1
;Show icons in the list
;Type=boolean
FindInPath=0
;To search also in the path of files
;Otherwise, it only searches the file name
;Type=boolean
;Default=0
ShowTTip=0
;To show tooltip with detailed file info under the main window
;Type=boolean
ShowBigView=0
;Type=boolean
;To use the extended view of the main window
GuiFont=Trebuchet MS Félkövér
;Font to be used in the main window in case of small view
GuiColor=E3E3E3
;Background color of the main window
MaxItems=25
;Maximum number of search items to find

[Advanced]
OpenFolderWith=Explorer
;What program do you want to use to open folders of searched items
MaxLastUsed=25
;Maximum number of opened items to store in order to show when no search text is entered
WaitTime=200
;Milliseconds to wait for key strokes before search starts when you enter search text
MinLen=2
;Minimum characters before search starts
ShellIntegration=0
;Works only if compiled to exe!
;Shell Integration adds this script to all files' context menu, so that you can launch a file with any application selected in the script.
UsedList=|
;DON'T EDIT THIS UNLESS YOU KNOW WHAT YOU ARE DOING
;This contains the last opened items
),%IniFile%
Return


DoScan:
   ScanCheckTimerInt := 1 * (60*1000) ;mins

   SinceLast := A_TickCount-LastScanTick
   LastScanTick := A_TickCount
   SetTimer, DoScan, %ScanCheckTimerInt%


   GoSub, CheckScanDate_and_CreateMenus
   If (FDDiff > (-1*ScanPeriod)) ;less than X hours old listfile
   {
      ;MsgBox,Return at FDDiff
      Return
   }

   If (SinceLast-ScanCheckTimerInt > 10000) ;more than X msec late - coming from hibernate
   {
      ;MsgBox,Return at Late
      Return
   }

   If (A_TimeIdle < (20*1000)) ;Idle for X sec
   {
      ;MsgBox,Return at Idle
      Return
   }

   CntDn = 10
   Loop, %CntDn%
   {
      ;SplashImage,, %Spl_Design%,% "Scanning starts in " CntDn+1-A_Index " sec...",Computer idle
      If (A_TimeIdle < (20*1000))
      {
         GoSub, RemoveTrT
         Return
      }
      Sleep, 990
      ;GoSub, RemoveTrT
   }
   SetTimer, DoScan, Off
   Gosub, ButtonScan
   LastScanTick := A_TickCount
   SetTimer, DoScan, %ScanCheckTimerInt% ;mins
Return

AltIndexFile:
If not AltIndex
{
   IfNotExist,%A_ScriptDir%\Net%ListFile%
   {
      FileSelectFile, IndexFile2, 3, %A_ScriptDir%, Open a new IndexFile, *.lst
      If not IndexFile2
         Return
      IndexFile := IndexFile2
   }
   else
      IndexFile = %A_ScriptDir%\Net%ListFile%
   AltIndex = 1
}
else
{
   AltIndex =
   IndexFile = %A_ScriptDir%\%ListFile%

}
GoSub, ReadScanFile
ControlFocus, Edit1, %MainWnd%
GoTo, GetText
Return

ReadScanFile:
   SplashImage,, %Spl_Design2%,Please wait,Loading index...
   ItemList =
   FileGetSize, LFSize, %IndexFile%
   VarSetCapacity(ItemList,LFSize)

   ln =
   Loop, Read, %IndexFile%
   {
      IfEqual, A_LoopReadLine,
         Continue
      ln ++
      ItemList = %ItemList%|%A_LoopReadLine%
   }

   ; ln =
   ; Loop, Parse, ItemList, |
      ; ln ++
   SplashImage,OFF
   ;SplashImage,, %Spl_Design2%, % round(LFSize/1024) . " K = " . ln . " lines",Item list loaded
   ;SetTimer, RemoveTrT, 3000
Return

myShow(Smsg,Stitle,Sdesign="",Stime=3000,SonlyWhenActive=1)
{
Global
If SonlyWhenActive
   IfWinNotActive,%MainWnd%
      Return
Sdes := Spl_Design%Sdesign%
SplashImage,, %Sdes%, % Smsg, % Stitle
If Stime
   SetTimer, RemoveTrT, % Stime
Return
}

RemoveTrT:
   SetTimer, RemoveTrT, Off
   ;TrayTip
   SplashImage, OFF
return

Me