Log in

View Full Version : Using Apply in a script.


hello_hello
3rd May 2026, 14:45
Back in my early days of using Avisynth I must have read the page on Apply in the Avisynth docs, then promptly forgot about it.

Several years ago I rediscovered Apply, which lead me to create a small challenge for myself.... to one day use it in a script. To make it a worthwhile challenge I included a simple rule... I would only use Apply when it made sense because doing so simplified the script syntax, or make it a little easier to follow. Every so often I revisit that challenge and fail. Maybe I should call it a day and consider a similar "function object" challenge instead (aside from using them with a runtime filter).

If only Apply accepted named arguments for the functions it calls.... although if it did, using it wouldn't be a challenge. :(
Apply("catch", 22)

StainlessS
3rd May 2026, 19:30
Probably the most forgettable function in Avisynth script.

Gavino
4th May 2026, 00:06
Apply() is probably redundant now that AVS+ has function objects, but I used it in a script in this 2020 post (admittedly for a not very practical use-case!).

Emulgator
13th May 2026, 16:41
Exist(String(vidfolder0)+String(vidfile0)+String(vidpid0)+String(vidext0)) ? Apply(vidsrc0,String(vidfolder0)+String(vidfile0)+String(vidpid0)+String(vidext0)) \
: Assert(false, "! NO SUCH AV FILE -> " + String(vidfolder0)+String(vidfile0)+String(vidpid0)+String(vidext0) + "<- NO SUCH AV FILE !")
Using such things daily.