I’d like to access last mesh used by liquify tool. The path on my system is: C:\\Users\\{my_username}\\AppData\\Roaming\\Adobe\\Adobe Photoshop 2021\\Adobe Photoshop 2021 Settings\\Liquify Last Mesh.psp. How can I get my_username dynamically instead of hardcoding it?
I tried the usual NodeJS way: process.env.APPDATA. In a NodeJs session it returns my appdata path, but in a UXP plugin, it’s undefined.
UXP does not support arbitrary file access in this manner, so even if you could get the username, you’d still need to display a file picker to access the location.
You can, however, store a persistent token so that you only need to ask for the above path once.
Does using the %AppData% alias – like %APPDATA%\\Adobe\\... as the path – work? That way you it would also work in case the application data folder is not on Drive C.
I believe %APPDATA% links to \AppData, so %APPDATA%\\AppData\\ part should be just %APPDATA%\\ Or as Kerri suggested, it maybe links even to \Roaming - %APPDATA%\\Adobe\\...