BUG: The app object is missing files when "Pair renaming" is on!
Pretty sure this worked before, but it's broken in version 4.21.
If you have files that can pair up, the script doesn't see them if "Pair renaming" is on.
This busts many advanced JS solutions to paired renaming problems.
For example make these files:
type nul > "2025-01-11_17-26-21.HEIC"
type nul > "2025-01-11_17-26-21.MOV"
type nul > "2025-01-11_19-32-58.MOV"
type nul > "2025-01-11_19-55-24.HEIC"
type nul > "2025-01-11_19-55-24.MOV"
Aren, in the lower left, reports "5 Items" whether or not pair renaming is active -- this is correct.
But Aren's javascript hides "paired" files!
Use this code in the prebatch and/or item batch:
if (typeof index == "undefined") {
reportStr = `Prebatch found ${app.itemCount} files:\n`;
index = 0;
}
else reportStr = `Item batch found ${app.itemCount} files:\n`;
for (let J = 0, L = app.itemCount; J < L; J++) {
reportStr += (app.getItem (J) ).name + (app.getItem (J) ).ext + "\n";
}
if (index ===0 ) console.log (reportStr);
//--------------
Five files should be listed in the console.
But with paired renaming active, only three are shown.
**** Please make all files always available via the app object. ***
Regards,
Randy
If you have files that can pair up, the script doesn't see them if "Pair renaming" is on.
This busts many advanced JS solutions to paired renaming problems.
For example make these files:
type nul > "2025-01-11_17-26-21.HEIC"
type nul > "2025-01-11_17-26-21.MOV"
type nul > "2025-01-11_19-32-58.MOV"
type nul > "2025-01-11_19-55-24.HEIC"
type nul > "2025-01-11_19-55-24.MOV"
Aren, in the lower left, reports "5 Items" whether or not pair renaming is active -- this is correct.
But Aren's javascript hides "paired" files!
Use this code in the prebatch and/or item batch:
if (typeof index == "undefined") {
reportStr = `Prebatch found ${app.itemCount} files:\n`;
index = 0;
}
else reportStr = `Item batch found ${app.itemCount} files:\n`;
for (let J = 0, L = app.itemCount; J < L; J++) {
reportStr += (app.getItem (J) ).name + (app.getItem (J) ).ext + "\n";
}
if (index ===0 ) console.log (reportStr);
//--------------
Five files should be listed in the console.
But with paired renaming active, only three are shown.
**** Please make all files always available via the app object. ***
Regards,
Randy