Тема: VBScript: Изменения для запуска программы
Здравствуйте.
Изначально скрипт создается программой textpipe - для изменения собственного фильтра.
' This VBScript code was generated by TextPipe Pro -
' the fastest search and replace tool on the planet
' Download from: http://www.datamystic.com
Option Explicit
'The global TextPipe Application object
dim TextPipeApp
'The global TextPipe Filter Window
dim TPWindow
'connect to TextPipe if we haven't already
sub vb_connectTextPipe()
on error resume next
Set TextPipeApp = CreateObject("TextPipe.Application")
if Err.Number <> 0 then
MsgBox "TextPipe Pro is not installed." & vbCrLF & _
vbCrLf & _
"Please download and install it from" & vbCrLF & _
"http://www.datamystic.com", _
vbExclamation + vbOkOnly, _
"TextPipe Pro needs to be installed"
end if
Set TPWindow = TextPipeApp.newWindow
end sub
'disconnect from TextPipe
sub vb_disconnectTextPipe()
if isObject( TPWindow ) then
TPWindow.closeWithoutSave
Set TPWindow = Nothing
end if
if isObject( TextPipeApp ) then
Set TextPipeApp = Nothing
end if
end sub
' 1) Use this code to simply load the saved filter:
sub vb_load_filter()
vb_connectTextPipe
TPWindow.openFilter "G:\170\name.fll"
if TPWindow.execute = false then MsgBox "ERROR " & vbCrLF & TPWindow.errorText
vb_disconnectTextPipe
end sub 'End subroutine
' 2) Use this code to build the filter from scratch, from a web page,
' ASP script, .vbs file etc.
sub vb_build_filter( TPWindow )
dim f1,f2,f3,f4,f5,f6
TPWindow.startFilters
TPWindow.clearAllFilters
TPWindow.logEnabled = false
TPWindow.logFilename = "textpipe.log"
TPWindow.logAppend = true
TPWindow.logThreshold = 500
TPWindow.inputMode = 1
TPWindow.inputBinaryFiles = 1
TPWindow.inputBinarySampleSize = 100
TPWindow.inputPromptOnEach = false
TPWindow.inputPromptOnReadOnly = false
TPWindow.inputDeleteFiles = false
TPWindow.inputInsideCompressed = false
f1 = TPWindow.addReplaceFilter( " href=" & chr(34) & "_/([^" & chr(34) & "]+).htm", " href=" & chr(34) & "1/$1.htm", 4, false, false, false, true, false, false, false, 0 )
f1 = TPWindow.setPerl( 4096, false, false, true, false )
f1 = TPWindow.addReplaceFilter( " href=" & chr(34) & "__/([^" & chr(34) & "]+).htm", " href=" & chr(34) & "2/$1.htm", 4, false, false, false, true, false, false, false, 0 )
f1 = TPWindow.setPerl( 4096, false, false, true, false )
f1 = TPWindow.addReplaceFilter( " href=" & chr(34) & "___/([^" & chr(34) & "]+).htm", " href=" & chr(34) & "3/$1.htm", 4, false, false, false, true, false, false, false, 0 )
f1 = TPWindow.setPerl( 4096, false, false, true, false )
f1 = TPWindow.addCommentFilter( "Comments" & vbCrLf & vbCrLf )
TPWindow.outputMode = 1
TPWindow.outputRetainDate = false
TPWindow.outputTestMode = 2
TPWindow.outputAppend = false
TPWindow.outputOnlyOutputChangedFiles = 1
TPWindow.outputOpenOutputOnCompletion = false
TPWindow.outputExtension = ""
TPWindow.outputFolder = ""
TPWindow.outputRemoveEmpty = false
TPWindow.endFilters
'File List:
TPWindow.clearAllFiles
TPWindow.addFile "", 0, 1
TPWindow.addFile "Use the line below to remove common non-text files from website processing", 0, 3
TPWindow.addFile ".[ 'gif' or 'png' or 'jpg' or 'bmp' or 'avi' or 'ico' or 'mp3', lineEnd ]", 0, 5
TPWindow.addFile "Use the line below to remove common non-text folders from website processing", 0, 3
TPWindow.addFile "_vti", 0, 5
TPWindow.addFile "", 0, 1
TPWindow.addFile "", 0, 1
end sub 'End subroutine
sub vb_generate_filter()
vb_connectTextPipe
vb_build_filter( TPWindow )
if TPWindow.execute = false then MsgBox "ERROR " & vbCrLF & TPWindow.errorText
vb_disconnectTextPipe
end sub 'End subroutine
' 3) Use this code to build the filter from scratch and process a form field
sub vb_filter_string()
vb_connectTextPipe
vb_build_filter( TPWindow )
form1.output.value = TPWindow.processString( form1.input.value )
vb_disconnectTextPipe
end sub 'End subroutine
'Uncomment the following line to load the filter
' vb_load_filter()
'Uncomment the following line to generate the filter
vb_generate_filter()Но с портабельной версией программы, работать не хочет, а выдает сообщение что textpipe не установлен. (подозреваю что дело в путяхзапуска) Подскажите, как правильно отредактировать данный скрипт чтобы он работал с портабельной версией.
Спасибо.

