I recently realized that opening files through UXP (app.open), feeding it a list of UXPFileEntry, doesn’t update the Recent Files list. Can someone please help check whether I am doing something wrong, missing something, or if this is a bug/missing feature from Adobe’s side?
Thank you!
Other info:
- Both
File -> Open Recent
and theRecent
page when you first open Photoshop are not updated. - sample code:
- // Get files to open
const lfs = require('uxp').storage.localFileSystem; const files = await lfs.getFileForOpening({allowMultiple: true});
const exeModal = require('photoshop').core.executeAsModal; const app = require('photoshop').app const psAction = require("photoshop").action;
try{ await exeModal(async function(){ if (files.length > 0) { for (let i = 0; i < files.length; i ++){ const newDocument = await app.open(files[i]); } } }, {"commandName": "Opening selected file..."});} catch(e){ app.showAlert(`Failed to open some files!`); };