Total Commander Forum Index Total Commander
Форум поддержки пользователей Total Commander
Сайты: Все о Total Commander | Totalcmd.net | Ghisler.com | RU.TCKB
 
 RulesRules   SearchSearch   FAQFAQ   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Single Post  Topic: [WISH] Переход к следующей папке не выходя из текущей 
Author Message
Volniy



PostPosted: Sat Jun 09, 2007 21:09    Post subject: Reply with quote

Вот черновичек, вроде работает:
Code:
'(c) 2007, Volniy

 Option Explicit
 Dim TCS, D, prevD, FSO
 
 Set TCS = CreateObject("TCScript.Helper")
 Set FSO = CreateObject("scripting.filesystemobject")
 
 TCS.SendCommand 2002 ' cm_GoToParent
 prevD = TCS.GetSrcSelectedFiles(True)(0)
 TCS.SendKeystroke "{DOWN}"
 D = TCS.GetSrcSelectedFiles(True)(0)
 If (FSO.FolderExists(D)=True) Then
    If (StrComp(prevD,D,vbTextCompare)<>0) Then
       TCS.SendCommand 2003 ' cm_GoToDir
    Else
       MsgBox "No more directories in the file panel!", vbExclamation, "Error!"
       ' Call GoTo1stDir
    End If
 Else
    MsgBox "File is selected, no more directories!", vbExclamation, "Error!"
    ' Call GoTo1stDir
 End If

 Set TCS = Nothing
 Set FSO = Nothing
 WScript.Quit

Sub GoTo1stDir
   TCS.SendKeystroke "^{HOME}"
   TCS.SendCommand 2003 ' cm_GoToDir
End Sub


Примечание: два закоментированных Call-a будучи раскомментированными будут открывать первую директорию в панели после сообщений о том что список директорий закончился (сообщения в этом случае можно и убрать, я думаю).


Last edited by Volniy on Sun Jun 10, 2007 12:15; edited 1 time in total
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group