Created
          November 9, 2014 08:52 
        
      - 
      
- 
        Save qtxie/38f5871d53bbc22314ce to your computer and use it in GitHub Desktop. 
    Script for running red in EverEdit
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | Dim strCommand | |
| Dim strFilename | |
| Dim strOutput | |
| Dim strLog | |
| strFilename = App.ActiveDoc.PathName | |
| strLog = strFilename & ".result" | |
| strCommand = "cmd /c E:\red-043.exe {0} > {1} 2>&1" | |
| strCommand = Replace(strCommand, "{0}", strFilename) | |
| strCommand = Replace(strCommand, "{1}", strLog) | |
| Set objShell = CreateObject("WScript.Shell") | |
| ' Not show window and wait until finished | |
| objShell.Run strCommand, 0, True | |
| Set fso = CreateObject("Scripting.FileSystemObject") | |
| Set file = fso.OpenTextFile(strLog, 1, False, -1) | |
| If file.AtEndOfStream Then | |
| ' No output | |
| Else | |
| strText = file.ReadAll | |
| file.close | |
| App.OutputText strText, True, False | |
| End If | |
| Set fso = Nothing | |
| Set objShell = Nothing | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment