I would like to save a TIF file but with extension “.abc” instead of “.tif”.
I’m saving the TIF using fs.getFileForSaving(“MyFile.abc”), but PS is clever and nevertheless saves it as MyFile.tif.
As workaround I’m trying to save the file as *.tif and rename it afterwards using the UXP API function renameEntry() using following code:
var MyFolder = await require('uxp').storage.localFileSystem.getFolder(); // User needs to select folder var entry = await MyFolder.getEntry("MyFile.tif"); // Loads mentioned file as "entry" await MyFolder.rename(entry, "MyFile.abc"); // Renames the entry
If I debug that I can see that the first 2 lines are working well, and that “entry” properly contains the file “MyFile.tif”.
But the rename() itself does not do anything.
Does anyone have a idea what the problem could be? Do I need a “Session Token” here as well as for the saving?
Or maybe someone has an idea how to tell PS directly to save a file with a custom extension.