Running PWS scripts

Come up with a useful post-processing script? Share it here!
Post Reply
scomcat
Newbie
Newbie
Posts: 2
Joined: August 9th, 2012, 5:20 pm

Running PWS scripts

Post by scomcat »

I'm trying to figure out how to run post processing scripts. I assume that any scripts in the Post-Processing Scripts Folder are run? What sequence, alphabetical?

I'm running Windows 7 and would like to run some powershell scripts to copy to my NAS. I assume I just create a script, e.g. test.ps1, and place it into that folder, and then use the documented parameters in the script? Right now I'm just trying to echo the args into a text file but I'm not getting anything out of SAB:

date |out-file D:\temp\sab.script.txt -append
$args[0] |out-file C:\temp\sab.script.txt -append
$args[1] |out-file C:\temp\sab.script.txt -append
etc.

Any examples on Windows scripts for copying and renaming folders, e.g. "TV Shows\Show\season\episode name.mkv"
NoTolerance
Full Member
Full Member
Posts: 127
Joined: June 27th, 2012, 9:55 am

Re: Running PWS scripts

Post by NoTolerance »

You have to tell sab which post-processing script you want to use for each category you've defined. If you want to run multiple scripts for a single download, you'll have to write a "container script" that basically calls all your subscripts - each category can only have a single post-processing script assigned to it.

So basically, write your script and save it to the folder you defined for post-processing scripts in sab's config (under Folders - User Folders).
Assign the script to the Category you want it to run for.
Test.
jowi
Newbie
Newbie
Posts: 19
Joined: August 9th, 2012, 6:16 am

Re: Running PWS scripts

Post by jowi »

Go to sab's config, create a category and enter the post processing script you want to be executed there.
(or use the default item so the script is executed for all downloads)
Image
scomcat
Newbie
Newbie
Posts: 2
Joined: August 9th, 2012, 5:20 pm

Re: Running PWS scripts

Post by scomcat »

Excellent. I can now run the scripts.

However when I use the PowerShell script they never seem to complete so I don't know what it's trying to do. Running the script outside of SAB it completes in a split second.

When I run a cmd with echo %1 commands it completes just fine. I tried running the PWS script from the CMD, but again it never completed. For some reason it doesn't like running the PWS script from SAB.
User avatar
shypike
Administrator
Administrator
Posts: 19773
Joined: January 18th, 2008, 12:49 pm

Re: Running PWS scripts

Post by shypike »

What if you wrap the powershell script in a CMD script?
Post Reply