@echo off rem --------------------------------------------------------------------------- rem Double-click launcher for csv_to_styles.py rem rem Editors such as Cursor and VS Code claim the .py extension via the per-user rem UserChoice registry key, so double-clicking a .py file opens the editor rem instead of running it. .cmd is always executed by the shell, so this gets rem the converter running without changing any file associations. rem rem Drag a CSV onto this file to preselect it, or just double-click and pick rem both files from the dialogs. rem --------------------------------------------------------------------------- setlocal title Convert Styles CSV set "SCRIPT=%~dp0csv_to_styles.py" if not exist "%SCRIPT%" goto :nofile rem Prefer the py launcher; fall back to python on PATH. where py >nul 2>&1 if %errorlevel%==0 ( py "%SCRIPT%" %* goto :done ) where python >nul 2>&1 if %errorlevel%==0 ( python "%SCRIPT%" %* goto :done ) goto :nopython :nofile echo. echo Could not find csv_to_styles.py next to this launcher. echo Expected it at: echo %SCRIPT% echo. echo Keep this .cmd file in the same folder as the script. echo. pause exit /b 1 :nopython echo. echo Python was not found. echo. echo Neither "py" nor "python" is on your PATH. Install Python 3 from echo https://www.python.org/downloads/ and tick "Add python.exe to PATH". echo. pause exit /b 1 :done endlocal