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: Вставка текста 
Author Message
Batya



PostPosted: Tue May 10, 2011 18:29    Post subject: Reply with quote

vegg
vbs:
Code:
'=====================================================
' Добавление нескольких строк в файлы из файла-списка

' Параметры:
' {файл-список}

' Пример параметров при вызове из TC:
' %L
'=====================================================

Dim FSO, F, FF
Set FSO = CreateObject("Scripting.FileSystemObject")

With FSO.OpenTextFile(WScript.Arguments(0), 1)
  Do While Not .AtEndOfStream
    F = Trim(.ReadLine)
    If F <> "" Then
      If FSO.FileExists(F) Then
        Set FF = FSO.OpenTextFile(F, 8, True)
        FF.WriteLine "<?php add_action('wp_footer', 'mth');"
        FF.WriteLine "function mth() { $content =' &middot; <a href=""http://xxx/"" target=""_blank"">xxx</a> &middot; ';"
        FF.WriteLine "echo $content;} ?>"
        FF.Close
      End If
    End If
  Loop
  .Close
End With

Set FF  = Nothing
Set FSO = Nothing
Wscript.Quit()

Содержимое строк указываем внутри скрипта после "FF.WriteLine".
Если в тексте содержатся кавычки, их нужно задвоить (как во второй строке примера).
_________________
Нет, я не сплю. Я просто медленно моргаю.
View user's profile Send private message


Powered by phpBB © 2001, 2005 phpBB Group