Does "SaveForWeb" work in batchPlay?

I am building a plugin that will allow me to batch export jpgs and I am stuck trying to get a “SaveForWeb” approach using batchPlay to work. I’ve used tokens, I’ve used absolute paths or relative paths and just can’t seem to actually write out the jpg even though I get console logs that says it was successful. At times I’ll even get a ❌ Failed at quality 100: Could not find an entry of 'blob:/blob-1/compressed-22102_300x250_Albertsons.jpg'. And just to point out I really don’t want to use ExportAs because it only allows quality values 1-12 which doesn’t give us enough control with compressing our jpgs to met our max kb file sizes while retaining as much image quality as possible. I’ve read so many forums, asked chatgpt and just currently running in circles. Here is just one version of my code that utilized tokens that says it was successful but generates that blob: error:

async function testSaveForWebExport() {
  const { executeAsModal } = require('photoshop').core;
  const { batchPlay } = require('photoshop').action;
  const fs = require('uxp').storage.localFileSystem;

  const filename = '22102_300x250_TestSaveForWeb.jpg';

  if (!selectedOutputFolderFinal) {
    console.error('❌ No output folder set.');
    return;
  }

  console.log(
    `Selected Output Folder is: ${selectedOutputFolderFinal.nativePath}`
  );

  try {
    // Step 1: Create file + token
    const fileEntry = await selectedOutputFolderFinal.createFile(filename, {
      overwrite: true,
    });
    const token = await fs.createSessionToken(fileEntry);
    console.log(`🧪 SaveForWeb Export → ${fileEntry.nativePath}`);
    console.log(`🔑 Token: ${token}`);

    // Step 2: Execute batchPlay
    await executeAsModal(async () => {
      await batchPlay(
        [
          {
            _obj: 'export',
            _target: [
              { _ref: 'document', _enum: 'ordinal', _value: 'targetEnum' },
            ],
            using: {
              _obj: 'SaveForWeb',
              format: { _enum: 'IRFormat', _value: 'IRJPEG' },
              quality: 50,
              optimized: true,
              blur: 0,
              includeProfile: false,
            },
            in: {
              _pathToken: token,
              _kind: 'local',
            },
            _options: {
              dialogOptions: 'dontDisplay',
            },
          },
        ],
        { modalBehavior: 'execute' }
      );
    });

    console.log('✅ SaveForWeb batchPlay completed');

    // Step 3: Manually delay & re-check
    await new Promise((r) => setTimeout(r, 400));

    const entries = await selectedOutputFolderFinal.getEntries();
    const found = entries.find((f) => f.name === filename);

    if (found) {
      console.log(`✅ FOUND FILE: ${found.nativePath}`);
    } else {
      console.warn(
        `⚠️ File not found via getEntries() — SaveForWeb likely failed silently.`
      );
    }
  } catch (err) {
    console.error('❌ testSaveForWebExport failed:', err.message || err);
  }
}

And as for the path, I’ve used "in:{ , to:{ , _pathToken and _path all not generating an actual jpg to my disk. If anyone can give me any suggestions, feedback or insight I would appreciate it. Thanks!