Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure External Tool -HELP?? #111

Open
Ironwolfe opened this issue Aug 23, 2017 · 4 comments
Open

Configure External Tool -HELP?? #111

Ironwolfe opened this issue Aug 23, 2017 · 4 comments
Labels

Comments

@Ironwolfe
Copy link

Hi! I'm an IT Professional but must admit I'm quite a noob with programming and lower level OS function.. I have been searching for hours trying to find a simple solution to monitor a text file and alert me with audio when a keyword was added to the log - SnakeTail is AWESOME for everything except adding the sound and I'm pulling my hair out trying to "trial and error" my way into a usable syntax format on the external tool config screen LOL.

I have the latest version of VLC which I have demonstrated to launch minimized and play a .wav file directly from the Windows RUN command line and was hoping I could tweak it for use with ST?? I assume this config window is strictly for scripts/services and would not be able to reproduce the following desired function?:
C:\Program Files (x86)\VideoLAN\VLC\vlc.exe --qt-start-minimized "C:\Users\Trebor Ironwolfe\Documents\default.wav"

Any help MUCH APPRECIATED! ;>

@steinhaug
Copy link

steinhaug commented Apr 14, 2018

I would love some decoumentation with some examples here myself. I would so like to enhance the tail experiance with some colorizing, and possible alerts and hyperlinking aswell but do not understand hjow to from the external tools.

These external tools, can they be made in PHP? Again, anyone have any examples?

BTW, you might have some help by my post here:
https://stackoverflow.com/questions/49832770/snaketail-for-windows-how-to-configure-external-tool-arguments/49832891#49832891

@snakefoot
Copy link
Owner

@Ironwolfe Have you tried to add quotes around the exe-file, so it becomes:

"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" --qt-start-minimized "C:\Users\Trebor Ironwolfe\Documents\default.wav"

@Ironwolfe
Copy link
Author

Ironwolfe commented May 2, 2018

@snakefoot and @steinhaug
HAHAHA DOH!! Those silly lil upside-down commas appear to be quite powerful when used properly ;> Just had a successful test for audio .wav trigger on keyword!! TYTY Snakefoot!

For anyone else having problems configuring audio triggers - here is a brief summary of the "key item checklist" ... (based on my own local setup locations and VideoLan "VLC.EXE" audio player as external audio tool):

1. External audio file player (.exe): smaller the better. I used VLC.EXE made by VideoLAN.
2. Make clear and accurate notes to yourself for the following paths and filenames:
a) Full path to SnakeTail.EXE (aka ST) on your local machine.
b) Full path and filename of any "Saved Sessions" (.xml) you have created in ST and wish to use later.
c) Full path and filename of the logfile/text file that you wish to currently monitor or read in ST.
d) Full path and filename of a standard audio file you wish to play on keyword match in ST.
3. Terminology / Distinctions:
a) "Open File" simply loads a selected text/log file into the ST monitor/window/working memory.
b) "Save/Open Session" options let you save or open a customized version of ST which can include multiple-selected text/log files (as tabs in the ST window), keyword rules, and configuration options which are not already set/saved as "global" settings or "applied to all".
4. If you already have a saved session you can simply open it and proceed to configure the external tool for audio alert (described later). Otherwise, the external tool setup is the same process but you may wish to read instructed details on standard ST usage in the official ST faq/user guide.
5. Add your customized external tool for audible alerts:
a) On ST file menu: "Edit" -> "View Options" -> "External Tools" tab -> "Add" button (on right):
Complete only the following three fields (substitute generic [...] items with YOUR OWN).
Once these three fields are completed, click the OK button at bottom.
!!NOTE!! Very IMPORTANT that you include the quotation marks in the locations as indicated below.

  • Name: AUDIBLE_ALERTS

  • Command: "[PATH] \ [AUDIOPLAYER.EXE]"

                  (example: "C:\Program Files (x86)\VideoLAN\VLC\VLC.EXE" )
    
  • Arguments: --qt-start-minimized "[PATH] \ [AUDIOFILE.WAV]"

                  (example: --qt-start-minimized "C:\Program Files\SnakeTail\default.wav" )
    

6. In the same "Configure View" mode, click "Keyword Highlight" tab at top. Use "Add" button to create a new keyword or "Edit" if you wish to change an existing one you made previously. For either method, simply check the "Launch External Tool" checkbox for that keyword and select "AUDIBLE_ALERTS" from the dropdown list. Click OK at bottom and now the keyword should launch your external audio player and selected sound file each time it appears in the ST window/monitor.

Hope that helps - please pop over a message if anyone finds errors with this procedure or if you have better suggestions for my wording here to better clarify meaning ;>

ȾƦɆɃ

@Guardian820
Copy link

Guardian820 commented Feb 20, 2022

@snakefoot and @steinhaug HAHAHA DOH!! Those silly lil upside-down commas appear to be quite powerful when used properly ;> Just had a successful test for audio .wav trigger on keyword!! TYTY Snakefoot!

For anyone else having problems configuring audio triggers - here is a brief summary of the "key item checklist" ... (based on my own local setup locations and VideoLan "VLC.EXE" audio player as external audio tool):

1. External audio file player (.exe): smaller the better. I used VLC.EXE made by VideoLAN. 2. Make clear and accurate notes to yourself for the following paths and filenames: a) Full path to SnakeTail.EXE (aka ST) on your local machine. b) Full path and filename of any "Saved Sessions" (.xml) you have created in ST and wish to use later. c) Full path and filename of the logfile/text file that you wish to currently monitor or read in ST. d) Full path and filename of a standard audio file you wish to play on keyword match in ST. 3. Terminology / Distinctions: a) "Open File" simply loads a selected text/log file into the ST monitor/window/working memory. b) "Save/Open Session" options let you save or open a customized version of ST which can include multiple-selected text/log files (as tabs in the ST window), keyword rules, and configuration options which are not already set/saved as "global" settings or "applied to all". 4. If you already have a saved session you can simply open it and proceed to configure the external tool for audio alert (described later). Otherwise, the external tool setup is the same process but you may wish to read instructed details on standard ST usage in the official ST faq/user guide. 5. Add your customized external tool for audible alerts: a) On ST file menu: "Edit" -> "View Options" -> "External Tools" tab -> "Add" button (on right): Complete only the following three fields (substitute generic [...] items with YOUR OWN). Once these three fields are completed, click the OK button at bottom. !!NOTE!! Very IMPORTANT that you include the quotation marks in the locations as indicated below.

  • Name: AUDIBLE_ALERTS
  • Command: "[PATH] \ [AUDIOPLAYER.EXE]"
                  (example: "C:\Program Files (x86)\VideoLAN\VLC\VLC.EXE" )
    
  • Arguments: --qt-start-minimized "[PATH] \ [AUDIOFILE.WAV]"
                  (example: --qt-start-minimized "C:\Program Files\SnakeTail\default.wav" )
    

6. In the same "Configure View" mode, click "Keyword Highlight" tab at top. Use "Add" button to create a new keyword or "Edit" if you wish to change an existing one you made previously. For either method, simply check the "Launch External Tool" checkbox for that keyword and select "AUDIBLE_ALERTS" from the dropdown list. Click OK at bottom and now the keyword should launch your external audio player and selected sound file each time it appears in the ST window/monitor.

Hope that helps - please pop over a message if anyone finds errors with this procedure or if you have better suggestions for my wording here to better clarify meaning ;>

ȾƦɆɃ

Just remember you can write a script batch to pass arguments, you can also write on this batch script a PATH for the audio player executable. Like:

@echo off > NUL

::=========== INITIALIZER ============
:: DONT TOUCH OR CHANGE ANYTHING HERE!
SetLocal EnableDelayedExpansion
SET STATE=1

:: CONFIGURE YOUR PATHS
SET "PATH=C:\Program Files\VideoLAN\VLC;%PATH%"
SET HOME="C:\Program Files\SnakeTail"

START vlc.exe --qt-start-minimized %HOME%\bg.mp3

if %STATE%==1 (EXIT)
ENDLOCAL
EXIT

vlcscript.zip

@snakefoot long live to batch scripting, always POWERFUL for some works, lmao.

Also, remember to properly configure your VLC:

https://vlchelp.com/shutdown-pc-automatically-media-playlist-ends-vlc/

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants