Help: Call batch file from button
Posted: 15 Jul 2025 10:51
Hi - I am trying to call a batch file from a button. It works - but it is a but strange for me - I click the button and the script is partially displayed, and then I click the first line of the script and my script executes.
Is this the expected behavior or am I doing something wrong? THis is the script I am trying to call - and I would like to JUST click the button and have it execute:
The XYPLORER script int he Left Click section of the button:
THe batch script:
Is this the expected behavior or am I doing something wrong? THis is the script I am trying to call - and I would like to JUST click the button and have it execute:
The XYPLORER script int he Left Click section of the button:
Code: Select all
//S
if (<curpath> == "C:\MyStorage\Wallpapers") {
run """C:\Users\xxx\AppData\Roaming\espanso\scripts\run_filenames.bat""";
} else {
status "This button only works in C:\MyStorage\Wallpapers", "8B0000", "white";
}THe batch script:
Code: Select all
@echo off
REM Batch file to delete duplicate images and rename remaining ones.
setlocal
set SCRIPT=C:\Users\xxx\AppData\Roaming\espanso\scripts\filedups.py
set PYTHON=C:\Python312\python.exe
echo Running duplicate remover and renamer...
%PYTHON% "%SCRIPT%" "%CD%"
echo.
echo Done. Window will close in 5 seconds...
timeout /t 5 > nul
endlocal