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
Reply to #1:
If you turn on pair renaming, only the first file in a pair gets a new name. For the other files in the pair, they will get the name of the first master file. This applies to all methods, including the script method. Only the master file will be processed by the method. I don't remember a time when Advanced Renamer didn't behave like that. I just tested a couple of 4.xx and 3.xx versions and all of them behaved like that.

This is expected behavior - not a bug.
Reply to #2:

Yes, I re-looked into previous cases and they did not fail only due to (a) pure dumb luck or (b) the fact that Aren does not handle compound extensions well,

This is very definitely a bug. The behavior makes no sense for the JS object and clearly was an unpleasant surprise to (¿the?) two top power-users. I suspect that a double blind poll would find all of your JS users similarly wrong-footed.

I understand if it's not cost-effective to fix but the behavior should at least be documented on the https://www.advancedrenamer.com/user_guide/v4/method_script page.