I never found a way to pass a command line parameter directly to an AVS script. Scripting on the fly is the only way I could get it to work.
I know that this is not the answer you are looking for - nevertheless, there are two approaches for generating scripts:
Script template
I use this when I have an AVS script, where the only parameter that changes is the original input file.
I have a script template.avs that expects a variable ( v ) containing the full path of the source video. The script package then simply adds a line with a variable for each video file, similar to this:
@echo off if "%1" == "" ( echo No input video found pause GOTO :EOF ) set pth=%~dp0 :loop IF "%1"=="" GOTO :EOF echo v="%1">"%pth%_tmp.avs" type "%pth%template.avs">>"%pth%_tmp.avs" :: Do whatever you want with the script :: I use virtualdub... "%vdub%" /i "%pth%Template.vdscript" "%pth%_tmp.avs" del "%pth%_tmp" SHIFT GOTO loop
This allows me to simply drag and drop multiple source videos onto the package.
Import
Using the Import command, you can export all variable declarations to your own script.
Import("variables.avs")
This is useful when the AVS script template expects several variables.
source share