home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 June (DVD) / DPPRO0605DVD.iso / Extras / TextPipe / textpipepro-cr.exe / {app} / wizard / wizard.js < prev   
Encoding:
JavaScript  |  2004-03-31  |  2.8 KB  |  124 lines

  1. //The global TextPipe Application object
  2. var js_TextPipeApp;
  3. //The global TextPipe Filter Window
  4. var js_TPWindow;
  5.  
  6. //connect to TextPipe if we haven't already
  7. function js_connectTextPipe() {
  8.  
  9.   try {
  10.     if (js_TextPipeApp == null) 
  11.       js_TextPipeApp = new ActiveXObject("TextPipe.Application");
  12.       js_TextPipeApp.visible = true;
  13. //      js_TextPipeApp.bringToFront();
  14. //      js_TextPipeApp.restore();
  15.   }
  16.   catch(e) {
  17.     MsgBox( "TextPipe Pro is not installed.\n\n" +
  18.       "Please download and install it from\n" +
  19.       "http://www.crystalsoftware.com.au", 
  20.       48 + 0,
  21.       "TextPipe Pro needs to be installed" );
  22.   }
  23.  
  24.   try {
  25.     if (js_TPWindow == null) {
  26.  
  27.   js_TPWindow = js_TextPipeApp.newWindow();
  28.   js_TPWindow.startFilters();
  29.  
  30.   //remove everything defined by normal.fll
  31.   js_TPWindow.clearAllFilters();
  32.   js_TPWindow.clearAllFiles();
  33.  
  34.   //disable logging
  35.   js_TPWindow.logEnabled = false;
  36.   js_TPWindow.logFilename = "";
  37.  
  38.   //set standard input filter settings
  39.   js_TPWindow.inputMode = 1;
  40.   js_TPWindow.inputBinaryFiles = 0;
  41.   js_TPWindow.inputBinarySampleSize = 100;
  42.   js_TPWindow.inputPromptOnEach = false;
  43.   js_TPWindow.inputPromptOnReadOnly = false;
  44.   js_TPWindow.inputDeleteFiles = false;
  45.  
  46.   //set standard output filter settings
  47.   js_TPWindow.outputMode = 1;
  48.   js_TPWindow.outputRetainDate = false;
  49.   js_TPWindow.outputTestMode = false;
  50.   js_TPWindow.outputAppend = false;
  51.   js_TPWindow.outputOnlyOutputChangedFiles = false;
  52.   js_TPWindow.outputFolder = "";
  53.  
  54.   js_TPWindow.endFilters();
  55.  
  56.     }
  57.   }
  58.   catch(e) {
  59.     MsgBox( "Error creating filter window" );
  60.   }
  61. }
  62.  
  63.  
  64. function getRadioValue(radioObject)
  65.      { var value = null;
  66.        for (var i = 0; i < radioObject.length; i++)
  67.        { if (radioObject[i].checked)
  68.          {  value = radioObject[i].value;
  69.            break;
  70.          }
  71.        }
  72.        return value;
  73.      }                    
  74.  
  75. //disconnect from TextPipe
  76. function js_disconnectTextPipe() 
  77. {
  78.   js_TPWindow.closeWithoutSave();
  79.   js_TPWindow = null;
  80.   js_TextPipeApp.visible = false;
  81.   js_TextPipeApp = null;
  82. }
  83.  
  84.  
  85.  
  86. function transfer_files( TPWindow ) 
  87. {
  88.   TPWindow.clearAllFiles();
  89.  
  90.   //iterate through all lines in the list
  91.  
  92.   TPWindow.addFile( "start", 0, 1 );
  93.   for (var i = 0; i < test.file_list.length; i++)
  94.   { 
  95.     TPWindow.addFile( test.file_list[i], 0, 1 );
  96.   }  
  97.   TPWindow.addFile( "end", 0, 1 );
  98. }
  99.  
  100.  
  101.  
  102. function js_generate_filter( show_textpipe ) 
  103. {
  104.   js_connectTextPipe();
  105.  
  106.   if (show_textpipe == 1)
  107.     js_TextPipeApp.visible = true;
  108.  
  109.   window.frames[0].js_build_filter( js_TPWindow );
  110.   js_TPWindow.execute();
  111.   js_disconnectTextPipe();
  112.   alert( 'TextPipe processing has finished!' );
  113. }
  114.  
  115.  
  116. function js_edit_filter() 
  117. {
  118.   js_connectTextPipe();
  119.   js_TextPipeApp.visible = true;
  120.   window.frames[0].js_build_filter( js_TPWindow );
  121. }
  122.  
  123.  
  124.