관리 메뉴

ㄴrㅎnㅂrㄹrㄱi

폴더 탐색기 본문

AUTOHOTKEY/유틸리티

폴더 탐색기

님투 2012. 3. 8. 05:25
반응형

http://www.autohotkey.com/forum/topic8864.html&highlight=author+salvatore+agostino+romeo

 


 

/*
   Author:
      Salvatore Agostino Romeo
   E-Mail:
      romeo84@gmail.com
   Description:
      This script is usefull to navigate between folders in a very fast way.
   Functions:
      1)browse rapidely your folders and open files from here
      2)favourites folders submenu
      3)option to browse for folders and open this folders in dialogs such as Open Dialog box
      4)root submenu wich contains drives, cdrom drives and removable media
      5)submenu "back to" to quickly switch up 1,2,3,....  levels
      6)other minor functions
   Version:
      0.5
   License:
      GPL
   Note:
      subproject of AHKxplorer
*/

SetKeyDelay, -1
myFavouritesFolders=E:\Programmi|E:\ahk
; prepare open menu
Menu, open, add, here, openLab
Menu, open, add, in xplorer2, openLab
Menu, open, add, in Dialogs Windows, openLab
return

#Space::
   dir=%A_Desktop%
   navigate(dir)
return


navigate(folder)
   {
      global
      ; get favourites folder menu
      Menu, myFavFolders, add
      Menu, myFavFolders, deleteall
      StringSplit, mff, myFavouritesFolders, |
      Loop, %mff0%
         {
            currentFolder := mff%A_Index%
            Menu, myFavFolders, add, %currentFolder%, gotoFolder
         }
      ; get drives for "root" menu
      DriveGet, drvFixed, List, Fixed
      DriveGet, drvRemovable, List, REMOVABLE
      DriveGet, drvCD, List, CDROM
      drv=%drvFixed%%drvRemovable%%drvCD%
      StringSplit, d, drv
      item_num=0
      Loop,%d0%
         {
            tem:=d%A_Index% ":\"
            Menu, roots, add, %tem%, gotoFolder
         }
      StringRight, LastChar, Folder, 1
      if LastChar = \
         StringTrimRight, Folder, Folder, 1  ; Remove the trailing backslash.
      currentFolder =
      until := 0
      Menu, folderNavigator, add
      Menu, folderNavigator, deleteall
      Menu, backTo, add
      Menu, backTo, deleteall
      ; get folders for "back to" menu
      StringSplit, backToFolder, folder, \
      Loop, % backToFolder0-1  ;%
         {
            tempFold := backToFolder%A_Index%
            currentFolder = %currentFolder%%tempFold%\
            Menu, backTo, add,  %currentFolder%, gotoFolder
         }
      Menu, folderNavigator , add   , open ...,:open
      Menu, folderNavigator , add   , favourites ...,:myFavFolders
      Menu, folderNavigator , add   , root ...,:roots
      Menu, folderNavigator , add   ,
      Menu, folderNavigator , add   , back to ...,:backTo
      Loop, %folder%\* ,2
         {
            Menu, folderNavigator, add , %A_LoopFileName%%A_Tab% -> ,gotoFolder
            dir%A_Index% = %A_LoopFileFullPath%
            until := A_Index
         }
        
      Loop, %folder%\*
         {
            Menu, folderNavigator, add , %A_LoopFileName% ,gotoFolder
            num := A_Index + until
            dir%num% = %A_LoopFileFullPath%
         }
      MouseGetPos, x, y
      in_x := x-20
      in_y := y-20
      currentFolder=%folder%
      Menu, folderNavigator, show, %in_x%, %in_y%
      return
   }
openLab:
   if ( A_ThisMenuItemPos = 1)
      Run, %currentFolder%
   else if ( A_ThisMenuItemPos = 2)
      {
         ControlFocus, Edit1 , ahk_class ATL:ExplorerFrame
         ControlSend , Edit1, {BS}%currentFolder%\{Enter}, ahk_class ATL:ExplorerFrame
      }
   else if ( A_ThisMenuItemPos = 3)
      {
         ControlFocus, Edit1 , ahk_class #32770
         ControlSend , Edit1, {BS}%currentFolder%\{Enter}{BS}, ahk_class #32770
      }
return
gotoFolder:
   itemNum := A_ThisMenuItemPos - 5
   ;msgbox, % dir%itemNum%
   ;msgbox, until %until% itn %itemNum%
   if ( A_ThisMenu = "folderNavigator" and itemNum<=until)
      navigate(dir%itemNum%)
   else if ( A_ThisMenu = "folderNavigator" and itemNum>until)
      run, % dir%itemNum%
   else
      navigate(A_ThisMenuItem)
return

 


반응형
Comments