External Script - receiving a "string"

Hi All

I am trying to have an external script (.bat file in my case) return a String to the External Script action for error checking, where “OK” would been mean it was successful

would anyone have example .bat file that achieves this?

I’ve solved my own problem!

I used the following with the .bat file. The script is used to pass args to a python script, which turns power plugs off and on

python.exe c:\astro\batch\kasa.py powerplug --device %1 --switch %2
@echo OFF
if %errorlevel% == 0 (
echo OK
exit /b “OK”
) else (
echo Error
exit /b “ERROR”

Ok with .bat is correct.
With script you must use WScript (this another example for telescope but Echo si solution)

Dim objTele

'Create the telescope object
Set objTele = WScript.CreateObject("TheSkyX.sky6RASCOMTele")

'Connect to the telescope
'objTele.SetTracking(1, 1, 0, 0)

'See if connection failed
if (objTele.IsConnected = 0) then
	WScript.Echo "ERROR"
end if

Set objTele = Nothing

WScript.Echo "OK"