ExecuteScript Plugin - Install Steps for XP
From SqueezeboxWiki
This page needs editing. It may contain errors and/or outdated information.
Based on browsing a lot of posts in the forum, compiled the following steps that successfully installed and tested the "Execute Script" plugin for a Windows XP environment (GREAT PLUGIN... THANKS KEVIN!):
1)installed the Execute Script Plugin (ver r41) by Kevin Deane-Freeman 2)created and tested a .exe file created from a .bat file 3)created and tested a .vbs file to have HomeSeer execute a process
1. From google [1] Rgt clicked “Plugins-ExecuteScript-Plugin_r41.zip” and selected “Save Target As” and put into separate folder
2. Opened zip file and unzipped into same folder, created folder “ExecuteScript” with 2 subfolders and some files
3. Copied “ExecuteScript” folder and pasted to: C:\Program Files\SqueezeCenter\server\Plugins
4. Restarted SqueezeCenter “SC” (may not have been necessary)
5. From SC, Clicked on Settings, then on Plugins Tab - “Execute Script” was in plugin list and checked
6. Clicked on Execute Script / Settings – directions indicate to put scripts into folder: C:\Documents and Settings\All Users\Application Data\SqueezeCenter\prefs\scripts
7. Browsed to C:\Documents and Settings\All Users\Application Data\SqueezeCenter\prefs and created new folder “scripts” there.
8. Created test batch file and converted it to an exe file, to be executed by Execute Script:
C:\Batch Files\TestNotepad.bat @echo off echo Hello this is a test batch file to open Notepad Start /MAX C:\windows\notepad.exe Pause Tested batch file by opening it (opens Dos Window w/ msg; waits for any key to be pressed, and then opens NotePad)
Note: found (in later steps) that using this or other .bat files, when executed by ExecuteScript, would open and quickly close, a batch window but not execute the contents. Had to use Bat_to_Exe(free at http://www.f2ko.de/English/b2e/index.php ), to convert the .bat to a .exe file, “TestNotepad.exe”, which then would execute properly when executed by ExecuteScript.
9. Opened SC / Settings / Plugins / Execute Script plugin / Settings Now find “TestNotepad.exe” in drop down windows, in addition to “(none)”
10. Turn on logging…
SC / Settings / Advanced / Select “Logging” from dropdown menu Set item (plugin.executescript) – Execute Script to "Debug" Apply
11. Set ExecuteScript to execute the script when player is powered off…
SC / Settings / Plugins / Execute Script / Settings / On Power Off / TestNotepad.exe Apply
12. Use SC to power on squeezebox receiver – capture log for reference (no script entered for power on) Copy bottom portion of log: SC/Settings/Status/SqueezeCenter Log File – click on “100” lines and scroll to bottom of log for latest entries
08-05-26 15:31:02.4694 Plugins::ExecuteScript::Plugin::commandCallbackPower (282) Execute: Power On 08-05-26 15:31:02.4706 Plugins::ExecuteScript::Plugin::doThisScript (222) Execute: using server pref 08-05-26 15:31:02.4712 Plugins::ExecuteScript::Plugin::doThisScript (232) Execute: No Script Selected
13. Use SC Center to Power Off squeezebox rceiver - DOS window opened, NotePad opened, (close DOS window by typing any key)
08-05-26 15:33:33.1349 Plugins::ExecuteScript::Plugin::commandCallbackPower (285) Execute: Power Off 08-05-26 15:33:33.1358 Plugins::ExecuteScript::Plugin::doThisScript (222) Execute: using server pref 08-05-26 15:33:33.1365 Plugins::ExecuteScript::Plugin::doThisScript (227) Execute: Executing C:\Documents and Settings\All Users\Application Data\SqueezeCenter\prefs \scripts\TestNotepad.exe
This concludes setup and successful test.
Note: a .vbs script (executes successfully) to have ExecuteScript cause HomeSeer speak when SB player is powered off:
Dim hs Set hsi = createobject("HomeSeer2.application") hsi.SetHost "localhost" rval = hsi.Connect("default","default") if rval <> "" then msgbox rval end if Set hs = hsi.GetHSRef hs.speak "Turn Squeeze Box Amplifer Off"