I'll modify the batch file to make it draggable so you can drag .blend files onto it, and it will process those specific files while still outputting to the `\output` folder.
I'm modifying the batch file to accept dragged files as input instead of processing all files in an input folder, while keeping the output to the \output directory.
**Chunk 1**
Lines added: 11, lines removed: 2
```diff
@@ -4,6 +4,15 @@
echo Starting Blender file compression...
- REM Create input and output directories if they don't exist
- if not exist "input" mkdir "input"
+ REM Check if files were dragged onto the batch file
+ if "%~1"=="" (
+ echo.
+ echo Usage: Drag .blend files onto this batch file to compress them.
+ echo Output will be saved to the \output folder.
I see the issue! The problem is with the escape characters in the batch file when creating the Python script. The `^` characters are being interpreted incorrectly. Let me fix this by properly escaping the Python code in the batch file.
I'm fixing the escape character issues in the Python script generation by properly handling the quotes and special characters in the batch file.
**Chunk 1**
Lines added: 1, lines removed: undefined
```diff
@@ -20,4 +20,5 @@
set "TEMP_SCRIPT=compress_blend_temp.py"
echo Creating Python script: !TEMP_SCRIPT!
+
(
echo import bpy
```
**Chunk 2**
Lines added: 1, lines removed: 1
```diff
@@ -33,5 +34,5 @@
echo os.makedirs^("output"^)
echo.
- echo # Get command line arguments (the dragged files)
+ echo # Get command line arguments ^(the dragged files^)
echo blend_files = sys.argv[sys.argv.index^("--"^) + 1:] if "--" in sys.argv else []
echo.
```
</details>
---
The issue was with the escape characters in the batch file. I've fixed the Python script generation by properly escaping the parentheses and quotes. The key changes:
1.**Fixed escape characters**: Changed `^(` to `^(` and `^)` to `^)` for proper escaping
2.**Added spacing**: Added a blank line before the Python script generation for better readability
3.**Consistent escaping**: Made sure all special characters are properly escaped
Now when you drag `.blend` files onto the batch file, it should:
1. Successfully create the temporary Python script
2. Process the dragged files
3. Save compressed versions to the `\output` folder
Try dragging some `.blend` files onto it now - it should work without the "Failed to create script file" error!