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. |
10th November 2021, 22:07 | #81 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Quote:
try, replace this Code:
N = ScriptFile() LN = LCase(N) NLen = StrLen(N) ELen = FindStr(LN, ".avs") - 1 File_Name = LeftStr(N, NLen-(NLen-ELen)) FName = (FileName == "") ? File_Name : FileName File = FName + "_Combing.txt" Code:
File_Name = ScriptFile().RT_FilenameSplit(14) # Drive + Path + name (no extension) FName = (FileName == "") ? File_Name : FileName File = FName + "_Combing.txt" RT_DebugF("File = '%s'",File,name="Danette: ")
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 10th November 2021 at 22:34. |
|
10th November 2021, 22:32 | #82 | Link |
Registered User
Join Date: Apr 2013
Posts: 346
|
Removing those lines didn't work, but the replacement lines did work. At least, there is no error message being generated.
I'll try a batch run and see if that does what it should do. I'll report back ...good or bad. |
11th November 2021, 10:25 | #83 | Link |
Registered User
Join Date: Mar 2011
Posts: 4,829
|
From post #70
00000720 452.90887451 [4020] Danette: N=01 Destination Tucson (1)_Track01.avs 00000721 452.90890503 [4020] Danette: NLEN=38 00000722 452.90896606 [4020] Danette: ELen=34 Maybe I'm even more mathematically challenged than I realised, but I've counted the characters in the file name several times and each time I've counted 37. I could create a similar problem by starting a new script in AvsPMod. Originally I thought the extra character in the name was the culprit, but for me it works even before saving the script to my hard drive, as long as when I create a new tab I change the name to give it an avs extension. Did the script have an avs extension in the tab? DebugView shows it having one, but you said it was working at that time. So the new tab name might be >*New File (2) and you can rename it as >*New File (2).avs After refreshing the video preview it becomes *New File (2).avs and there's no error. It seems there's no need to actually save the script for it to work. Is there a setting I can't find for telling AvsPMod to give new tab names an avs extension? I don't know why it shouldn't, instead of waiting for the script to be saved before automatically adding it. If the StainlessS version works you might as well use it, but this will also prevent the error. Without an avs extension, it'll just use the full file name for the text file's name. The line I changed is blue. N = ScriptFile() LN = LCase(N) NLen = StrLen(N) ELen = FindStr(LN, ".avs") - 1 File_Name = (ELen > 0) ? LeftStr(N, ELen) : N FName = (FileName == "") ? File_Name : FileName File = FName + "_Combing.txt" Until the script is saved though, the text file will be written to the AvsPMod directory, assuming, I suppose, it resides somewhere where Windows will let it. Last edited by hello_hello; 11th November 2021 at 12:17. |
11th November 2021, 12:10 | #84 | Link | |
Registered User
Join Date: Mar 2011
Posts: 4,829
|
Quote:
So yes, this would produce exactly the same result (with the extra bit added to prevent the error when there's no extension). N = ScriptFile() LN = LCase(N) NLen = StrLen(N) ELen = FindStr(LN, ".avs") - 1 File_Name = (ELen > 0) ? LeftStr(N, ELen) : N FName = (FileName == "") ? File_Name : FileName File = FName + "_Combing.txt" Edit: I've changed it in my previous post too. Last edited by hello_hello; 11th November 2021 at 12:12. |
|
11th November 2021, 21:33 | #85 | Link | ||
Registered User
Join Date: Apr 2013
Posts: 346
|
Quote:
Quote:
With the above knowledge, I could, now, use the original script and run successfully by simply saving a script, in AvsPmod, first. However, since StainlessS’ replacement code negates the need for that step, I’ll just keep that code, unless either of you think the alternative code is better. Last edited by Danette; 11th November 2021 at 21:40. |
||
12th November 2021, 09:17 | #86 | Link | |
Registered User
Join Date: Mar 2011
Posts: 4,829
|
Quote:
If you don't save the script first, where is the text file written? For me it's the AvsPmod directory. If it's the same for the StainlessS version (I assume so) you could force the text file to be written to a specific directory for unsaved scripts, but it probably makes more sense just save it first. Having said that.... change the file path in red to whatever you prefer (it's only for unsaved scripts). If the path doesn't exist you'll get an error message. If you specify a path that would never exist (or leave it as it is), I guess you could use the error message as a reminder to save the script. Once it's saved, you can reload the video and it should work normally and the text file will be written to the same location as the script. You'll also need to update the lines in blue. Code:
N = ScriptFile() LN = LCase(N) NLen = StrLen(N) ELen = FindStr(LN, ".avs") - 1 Dir = (StrLen(ScriptDir()) < 2) ? "Z:\Save The Script\" : "" File_Name = (ELen > 0) ? LeftStr(N, ELen) : N FName = (FileName == "") ? Dir + File_Name : FileName File = FName + "_Combing.txt" Vid = Vid.GreyScale() CombTest = BlankClip(Vid, Color=color_red) Vid = Vid.TFM(Clip2=CombTest).TDecimate() global Everything = All Last edited by hello_hello; 12th November 2021 at 09:46. |
|
12th November 2021, 13:11 | #87 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
You can use below to replace/remove extension without any plugins required.
Quote:
Quote:
Code:
File_Name = ScriptFile().RT_FilenameSplit(7) # Drive + Path + name (no extension) Code:
RT_FilenameSplit(string filename,int "get"=15) Splits the un-named filename string into component parts selected by 'get' bit flags arg and returns the parts joined together. 'Get' (default 15, 1 -> 15), If set, Bit 0=DRIVE, 1=Dir, 2=Name, 4=Extension. Add 1 for Drive (bit 0), add 2 for Dir (bit 1), add 4 for Name (bit 2), add 8 for Extension (bit 3). Some combinations do not make sense, eg Drive + Extension (1+8=9). Below sensible options. 1 = Drive (includes trailing ':') 2 = Dir (includes trailing '\') 3 = Drive + Dir 4 = Name 6 = Dir + Name 7 = Drive + Dir + Name 8 = Extension (includes leading '.') 12 = Name + Extension 14 = Dir + Name + Extension # No Drive part 15 = Drive + Dir + Name + Extension Assuming a current working directory of eg "D:\avs\avi\", 'filename'="test.avi" and 'get'=15, returns "D:\avs\avi\test.avi", so given a relative filename and default 'get'=15, is equivalent to RT_GetFullPathName(filename).
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 12th November 2021 at 13:24. |
|
14th November 2021, 20:14 | #88 | Link | |
Registered User
Join Date: Apr 2013
Posts: 346
|
Quote:
I'm fine, now, with StainlessS' script change, which works in the preview mode before, and after, any script saving activity. |
|
|
|