<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; VBScript: Изменения для запуска программы]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7174&amp;type=atom" />
	<updated>2012-05-02T11:32:01Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=7174</id>
		<entry>
			<title type="html"><![CDATA[Re: VBScript: Изменения для запуска программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=59915#p59915" />
			<content type="html"><![CDATA[<p><strong>shveicar</strong>, чтобы объект был доступен, библиотека, его реализующая, должна быть зарегистрирована в реестре локальной системы.</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2012-05-02T11:32:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=59915#p59915</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[VBScript: Изменения для запуска программы]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=59914#p59914" />
			<content type="html"><![CDATA[<p>Здравствуйте.<br />Изначально скрипт создается программой textpipe - для изменения собственного фильтра.<br /></p><div class="codebox"><pre><code>&#039; This VBScript code was generated by TextPipe Pro -
&#039; the fastest search and replace tool on the planet
&#039;   Download from: http://www.datamystic.com

Option Explicit 

&#039;The global TextPipe Application object
dim TextPipeApp
&#039;The global TextPipe Filter Window
dim TPWindow


&#039;connect to TextPipe if we haven&#039;t already
sub vb_connectTextPipe()

  on error resume next
  Set TextPipeApp = CreateObject(&quot;TextPipe.Application&quot;)

  if Err.Number &lt;&gt; 0 then
    MsgBox &quot;TextPipe Pro is not installed.&quot; &amp; vbCrLF &amp; _
      vbCrLf &amp; _
      &quot;Please download and install it from&quot; &amp; vbCrLF &amp; _
      &quot;http://www.datamystic.com&quot;, _
      vbExclamation + vbOkOnly, _
      &quot;TextPipe Pro needs to be installed&quot;
  end if
  Set TPWindow = TextPipeApp.newWindow

end sub


&#039;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

&#039; 1) Use this code to simply load the saved filter:

sub vb_load_filter()

  vb_connectTextPipe
  TPWindow.openFilter &quot;G:\170\name.fll&quot;
  if TPWindow.execute = false then MsgBox &quot;ERROR &quot; &amp; vbCrLF &amp; TPWindow.errorText
  vb_disconnectTextPipe

end sub   &#039;End subroutine 


&#039; 2) Use this code to build the filter from scratch, from a web page,
&#039;    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 = &quot;textpipe.log&quot;
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( &quot; href=&quot; &amp; chr(34) &amp; &quot;_/([^&quot; &amp; chr(34) &amp; &quot;]+).htm&quot;, &quot; href=&quot; &amp; chr(34) &amp; &quot;1/$1.htm&quot;, 4, false, false, false, true, false, false, false, 0 )
f1 = TPWindow.setPerl( 4096, false, false, true, false )
f1 = TPWindow.addReplaceFilter( &quot; href=&quot; &amp; chr(34) &amp; &quot;__/([^&quot; &amp; chr(34) &amp; &quot;]+).htm&quot;, &quot; href=&quot; &amp; chr(34) &amp; &quot;2/$1.htm&quot;, 4, false, false, false, true, false, false, false, 0 )
f1 = TPWindow.setPerl( 4096, false, false, true, false )
f1 = TPWindow.addReplaceFilter( &quot; href=&quot; &amp; chr(34) &amp; &quot;___/([^&quot; &amp; chr(34) &amp; &quot;]+).htm&quot;, &quot; href=&quot; &amp; chr(34) &amp; &quot;3/$1.htm&quot;, 4, false, false, false, true, false, false, false, 0 )
f1 = TPWindow.setPerl( 4096, false, false, true, false )
f1 = TPWindow.addCommentFilter( &quot;Comments&quot; &amp; vbCrLf &amp; vbCrLf )
TPWindow.outputMode = 1
TPWindow.outputRetainDate = false
TPWindow.outputTestMode = 2
TPWindow.outputAppend = false
TPWindow.outputOnlyOutputChangedFiles = 1
TPWindow.outputOpenOutputOnCompletion = false
TPWindow.outputExtension = &quot;&quot;
TPWindow.outputFolder = &quot;&quot;
TPWindow.outputRemoveEmpty = false
TPWindow.endFilters


&#039;File List:
TPWindow.clearAllFiles
TPWindow.addFile &quot;&quot;, 0, 1
TPWindow.addFile &quot;Use the line below to remove common non-text files from website processing&quot;, 0, 3
TPWindow.addFile &quot;.[ &#039;gif&#039; or &#039;png&#039; or &#039;jpg&#039; or &#039;bmp&#039; or &#039;avi&#039; or &#039;ico&#039; or &#039;mp3&#039;, lineEnd ]&quot;, 0, 5
TPWindow.addFile &quot;Use the line below to remove common non-text folders from website processing&quot;, 0, 3
TPWindow.addFile &quot;_vti&quot;, 0, 5
TPWindow.addFile &quot;&quot;, 0, 1
TPWindow.addFile &quot;&quot;, 0, 1

end sub   &#039;End subroutine 


sub vb_generate_filter()

  vb_connectTextPipe
  vb_build_filter( TPWindow )
  if TPWindow.execute = false then MsgBox &quot;ERROR &quot; &amp; vbCrLF &amp; TPWindow.errorText
  vb_disconnectTextPipe

end sub   &#039;End subroutine 


&#039; 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   &#039;End subroutine 


&#039;Uncomment the following line to load the filter
&#039;  vb_load_filter()
&#039;Uncomment the following line to generate the filter
 vb_generate_filter()</code></pre></div><p>Но с портабельной версией программы, работать не хочет, а выдает сообщение что textpipe не установлен. (подозреваю что дело в путяхзапуска) Подскажите, как правильно отредактировать данный скрипт чтобы он работал с портабельной версией.<br />Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[shveicar]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27736</uri>
			</author>
			<updated>2012-05-02T11:21:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=59914#p59914</id>
		</entry>
</feed>
