Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
![]() |
|
Thread Tools | Search this Thread | Display Modes |
![]() |
#1 | Link |
User of free A/V tools
Join Date: Jul 2006
Location: SK
Posts: 826
|
Using environment variables in scripts - is it possible?
I'm trying to make use of system variables for portability of my scripts across more OS but the following syntax doesn't work for me:
Code:
LoadCPlugin("%PROGRAMFILES%\AVTools\Plugins\yadif.dll") ![]() Please note that this is a 'C' plugin and as such is not recommended to be put in common plugins autoload directory. Last edited by kypec; 8th April 2011 at 09:21. |
![]() |
![]() |
![]() |
#2 | Link |
Registered User
Join Date: Aug 2008
Posts: 233
|
Take a look at the GetSystemEnv plugin. You can use this to load environment variables…
… or, in my case: I use GetSystemEnv to find the AviSynth plugins folder by creating a file called AviSynthPluginsDir.avsi, which is auto-loaded. The file contains: Code:
global AviSynthPluginsDir = GetWorkingDir() So, for C:\Program Files\AviSynth 2.5\plugins\yadif\yadif.dll you can use: Code:
LoadCPlugin(AviSynthPluginsDir + "yadif\yadif.dll") |
![]() |
![]() |
![]() |
#3 | Link |
RedDwarf Fan
Join Date: Jun 2005
Location: United Kingdom
Posts: 198
|
This seemed like it could be useful to me as I have multiple windows installs and need to use scripts in each of them so they need to be portable between different windows.
But it is not full working. I am getting an error every time AvsP starts. Code:
Error parsing GetSystemEnv_GetSystemEnv plugin parameters: unknown character lol I typed it out rather than copying it and now it works without errors. The text looked identical but couldn't of been. So if you copy it, you could get an error! Last edited by RedDwarf1; 13th April 2010 at 23:10. |
![]() |
![]() |
![]() |
#6 | Link | |
RedDwarf Fan
Join Date: Jun 2005
Location: United Kingdom
Posts: 198
|
Quote:
Copying the text posted by vampiredom: Code:
global AviSynthPluginsDir = GetWorkingDir() Typing it out into Notepad and saving worked correctly. [EDIT] But whatever happened I cannot reproduce it now. The original file still causes the problem and looks identical to the working one. The format is identical Dos/Windows ANSI ![]() Last edited by RedDwarf1; 14th April 2010 at 15:45. |
|
![]() |
![]() |
![]() |
#7 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,439
|
Quote:
Because it involves memory corruption, the problem does not always show up, which explains why your two tests behaved differently. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|