Page 1 of 1

Windows to Mac script conversion? Delete extra files.

Posted: October 12th, 2012, 6:54 pm
by kalel786
Hey everyone!

I made the transition from Windows 7 to Mountain Lion.

This is my old post-processing script (cleanup.cmd) which worked fine with my Windows 7 setup. I renamed it to .py, tried to use it in MAC OS X, but it gives me an error, what changes do I have to make to convert it from a Windows 7 script to a Mac OS X script?
@echo off
setlocal
 
echo.
echo [Cleanup] Cleaning up download directory: %1
 
echo [Cleanup] Deleting .nzb files
DEL  %1\*.nzb  /S /F /Q
 
echo [Cleanup] Deleting .sfv files
DEL  %1\*.sfv  /S /F /Q

echo [Cleanup] Deleting .nfo files
DEL  %1\*.nfo  /S /F /Q

echo [Cleanup] Deleting .sub files
DEL  %1\*.sub  /S /F /Q

echo [Cleanup] Deleting .srr files
DEL  %1\*.sub  /S /F /Q

echo [Cleanup] Deleting .srs files
DEL  %1\*.sub  /S /F /Q

echo [Cleanup] Deleting .idx files
DEL  %1\*.idx  /S /F /Q

echo [Cleanup] Deleting .sample files
DEL  %1\*sample*.avi  /S /F /Q

echo [Cleanup] Deleting .srr files
DEL  %1\*.srr /S /F /Q


echo.
This is the error it gives me
"Exit(1) SyntaxError: unexpected character after line continuation character (More)"

Thanks in advance!

Re: Windows to Mac script conversion? Delete extra files.

Posted: October 13th, 2012, 1:40 am
by shypike
A Windows cmd file is not a Python program, so this can never work.
You don't need a script anyway.
In Config->General you can list all extension that should be deleted.
In Config->Switches you can set "Ignore samples" to "Delete after download".

Re: Windows to Mac script conversion? Delete extra files.

Posted: October 13th, 2012, 2:15 pm
by kalel786
shypike wrote:A Windows cmd file is not a Python program, so this can never work.
You don't need a script anyway.
In Config->General you can list all extension that should be deleted.
In Config->Switches you can set "Ignore samples" to "Delete after download".
Yeah I figured it wouldn't work. Thought I'd give it a try.

Anyways your method worked, THANKSSS XD.