Code: Select all
Selfilter "*.avi", f;Any more problems?
Code: Select all
Selfilter "*.avi", f;Good to knowzer0 wrote:To make sure it's the AVI file that is selected, I've used this line:As for pasting, make sure the indentation is correct -- after the 1st line, all subsequent lines need at least 1 space from the left edge. This is how the parser knows those lines are part of the same script.Code: Select all
Selfilter "*.avi", f;
Any more problems?
Code: Select all
Selfilter "*.avi", f;
$a = "<curbase>";
Selfilter "*.srt", f;
copyto ("1");
rename b, $a;
rename b, "*.ENG2";
What file is selected in that folder prior to launching the script shouldn't make any difference as the very first line takes care of selecting the AVI file.xyka wrote:Code: Select all
Selfilter "*.avi", f; $a = "<curbase>"; Selfilter "*.srt", f; copyto ("1"); rename b, $a; rename b, "*.ENG2";
Script is working well only if the avi has been selected before starting script.
ELSE:
Selfilter "*.avi", f; selects the avi file
but $a doesn't get the base name of the avi.
.
Yes, but you select file manually.zer0 wrote:It's not. Select any file and run this scriptYou will get the base name of that selected file.Code: Select all
$a = "<curbase>"; msg $a;
Code: Select all
Selfilter "*.txt", f; $a = "<curbase>"; msg $a;Code: Select all
Selfilter "*.txt", f; $a = "<curbase>"; msg $a;Code: Select all
Selfilter "*.txt", f; $a = "<curpath>"; msg $a;Code: Select all
Selfilter "*.txt", f;#1048; $a = "<curbase>"; msg $a;Code: Select all
Report "{Basename}|",1;Code: Select all
Sel "[*.txt]", 1, 1; $a = "<curbase>"; msg $a;Code: Select all
Selfilter "*.srt", f; $a = Report ("{Basename}",1); msg $a;Code: Select all
Sel "[*.avi]", 1, 1;
$a = "<curbase>";
Sel "[*.srt]", 1, 1;
copyto ("1");
rename b, $a;
rename b, "*.ENG2";
I try to use fewer blank lines next time.j_c_hallgren wrote:xyka: Could you kindly do us a favor and limit the amount of blank lines in your posts? It makes it harder to read because one can't see most of, or entire post without scrolling on smaller screens.
Use TheQwerty and zer0's posts as a guide for spacing that is enough so it's not all 'smushed' together but not too much either.
Code: Select all
https://addons.mozilla.org/en-US/firefox/addon/3235/Selfilter "angol", f;#1048;
run "C:\Program Files\WinRAR\WinRAR.exe" "e" "<curitem>",,1;
Code: Select all
Selfilter "*.avi", f;#1048;
$a = "<curbase>";
Selfilter "*.srt", f;#1048;
copyto ("1");
rename b, $a;
rename b, "*.ENG2";
Selfilter "angol", f;#1048;
run "C:\Program Files\WinRAR\WinRAR.exe" "e" "<curitem>",,1;
Selfilter "angol", f;#1048;
moveto ("1");
Selfilter "720p", f;#1048;
$count = Get("CountSelected");
if $count == 1 {
moveto ("1");
}Not sure why that works as, per help file, "names with blanks must be quoted. Note that the quotes have to be wrapped in single-quotes because an argument's outer quotes are auto-stripped by XY's script parser!"xyka wrote:@zer0, Winrar doesn't unrar file if I use your run command
Here is what works:Code: Select all
Selfilter "angol", f;#1048; run "C:\Program Files\WinRAR\WinRAR.exe" "e" "<curitem>",,1;
What you can do is embed another if loop (like one in step 11) into first part of 9.3.xyka wrote:Question: How can I select&focus the .srt file NOT ending with .ENG2.srt
(the .srt file has always different basename, so com.srt is not good)
(and the .srt file and .ENG2.srt can have different order)
In case ofzer0 wrote:...
11.Code: Select all
Selfilter "*.srt", f; $filelist = getinfo('SelectedItemsPathNames', '|'). '|'; $p = strpos($filelist, '|'); while ($p >= 0) { $file = substr($filelist, 0, $p); $name = regexreplace($file, "^.+\\(.+)$", "$1"); $filelist = substr($filelist, $p + 1); $p = strpos($filelist, '|'); if (strpos($name, ".ENG") == -1) { rename b, $a,,$file; } }
Code: Select all
http://www.zytrax.com/tech/web/regex.htm