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 

[Script] BarEditor

 
Post new topic   Reply to topic    Total Commander Forum Index -> Плагины Total Commander printer-friendly view
View previous topic :: View next topic  
Author Message
Lev



Joined: 02 Mar 2005
Posts: 392

Post (Separately) Posted: Wed Aug 29, 2007 23:40    Post subject: [Script] BarEditor Reply with quote

Мне понравилась идея утилиты BarEditor, надеюсь, скоро она перерастет возможности встроенного редактора bar-файлов Тотала, ну а пока она пытается имитировать текущую функциональность, мне подумалось - почему бы не вызывать существующий редактор для любого выделенного bar-файла. Итого скриптик:

Code:
'  File:         bareditor.vbs
'  Version:      1.0 beta
'  Description:  Открываем на редактирование выделенный бар файл
'  Installation:  Вешаем на кнопку, выделяем bar-файл, запускаем
'  (c) 2007, Lev F

'Option Explicit
'On error Resume Next
Dim TCS, f, ff, NewDir, FSO, nn, n, counter, fcount, tf
Set TCS = CreateObject("TCScript.Helper")
Set FSO = CreateObject("Scripting.FileSystemObject")

TCS.LockTC True
barfile=TCS.GetSrcSelectedFiles(True)(0)

sExt = LCase(FSO.GetExtensionName(barfile))
If sExt="bar" Then
   Section="Buttonbar"
   
   'запоминаем основной bar файл
   mainbar=TCS.INIRead (TCS.Mainini, Section, Section, 0)

   'вписываем редактируемый
   TCS.INIWrite TCS.Mainini,  Section,  Section,  barfile
   TCS.Pause = 100
   TCS.SendCommand(2901)'прячем-показываем button bar для его обновления
   TCS.SendCommand(2901)
   TCS.SendCommand "cm_ButtonConfig"
   
   'восстанавливаем основной bar файл
   TCS.INIWrite TCS.Mainini,  Section,  Section,  mainbar
   TCS.Pause = 100
   TCS.SendCommand(2901)'прячем-показываем button bar для его обновления
   TCS.SendCommand(2901)
End If
TCS.LockTC False
Set TCS = Nothing
Set FSO = Nothing
Wscript.Quit

Внимание: bar-файлы в скрипте не проверяются на корректность, и не встроена обработка данной ошибки. Сохраните копию ini файла ТС перед опытами.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Плагины Total Commander All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group