# Where to find list of save options?

**URL:** <https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221>\
**Category:** UXP Plugin API\
**Created:** [November 15, 2020, 8:09pm UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221 "2020-11-15T20:09:53Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![ddbell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ddbell/32/1030_2.png) [@ddbell](https://forums.creativeclouddeveloper.com/u/ddbell)\
**Post date:** [November 15, 2020, 8:09pm UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221/1 "2020-11-15T20:09:53Z")

</div>

Is there a list somewhere of the available save options per file type?

In this document, it shows how to save and shows an example of using the embedColorProfile save option.

Using { quality: 12 } works for jpg to save with quality level 12 (or any other value used). But that is the only save option I have figured out how to get to work. I am more or less just using trial and error in an attempt to figure out what to enter for the options.

So far, I’ve been able to get jpg, png and psd to save. However, tif doesn’t save at all. PNG will save with the last compression the user saved with. However, I want to force PNG to Large File Size (Quick compression). I would like to figure out how to make tif saving work too.

Anyway, just hoping maybe there was more reference material somewhere for saving images, or perhaps an example plugin show different save options.

[https://www.adobe.io/photoshop/uxp/ps\_reference/classes/document/#save](https://www.adobe.io/photoshop/uxp/ps_reference/classes/document/#save)

---

<div class="post-metadata">

**Author:** ![guircasimiro](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/guircasimiro/32/1072_2.png) [@guircasimiro](https://forums.creativeclouddeveloper.com/u/guircasimiro)\
**Post date:** [December 8, 2020, 11:48am UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221/2 "2020-12-08T11:48:16Z")

</div>

I saw this topic and maybe I can help.

The documentation does not describe this SaveOptions very well indeed, but I think the options in the save method was “imported” from CEP extensions I think. So if you take a look in photoshop javascripting scripting guide you will see the following options for JPEG files:

 ![Screenshot from 2020-12-08 08-45-40](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/2X/d/d940448357394d94cda246c110e99e99c0784db5.png)

For PNG and TIFF images there is some descriptions in there as well. I don’t know if it helps with your problem with tiff images, but this was what I found.

Hope it helps

---

<div class="post-metadata">

**Author:** ![ddbell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ddbell/32/1030_2.png) [@ddbell](https://forums.creativeclouddeveloper.com/u/ddbell)\
**Post date:** [December 9, 2020, 8:33am UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221/3 "2020-12-09T08:33:30Z")

</div>

Thanks. I am aware of the extendscript docs and did look through it and try some things out. However, I could never get tif to save. I figured I would just wait for more documentation on the subject because I am at a loss trying to figure it out with trial and error.

---

<div class="post-metadata">

**Author:** ![AnthonyK](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@AnthonyK](https://forums.creativeclouddeveloper.com/u/AnthonyK)\
**Post date:** [December 10, 2020, 3:58am UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221/4 "2020-12-10T03:58:29Z")

</div>

I saved .tif images using the batchPlay code generated by Listener. I set some options when saving and I think Listener caught those. It seemed to work, but I haven’t tested it extensively.

---

<div class="post-metadata">

**Author:** ![ddbell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ddbell/32/1030_2.png) [@ddbell](https://forums.creativeclouddeveloper.com/u/ddbell)\
**Post date:** [December 10, 2020, 4:05am UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221/5 "2020-12-10T04:05:11Z")

</div>

Can you reply with your function? I tried but couldn’t get it to work. Did you have to use the folderPicker to assign read/write access to the folder? Did you just feed the folder.nativePath from the folder picker folder into the batchPlay function?

---

<div class="post-metadata">

**Author:** ![AnthonyK](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@AnthonyK](https://forums.creativeclouddeveloper.com/u/AnthonyK)\
**Post date:** [December 10, 2020, 2:07pm UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221/6 "2020-12-10T14:07:47Z")

</div>

await require(‘photoshop’).action.batchPlay([  
//Save file as tif  
{"\_obj": “save”,“as”: {"\_obj": “TIFF”,“byteOrder”: {"\_enum": “platform”,"\_value": “IBMPC”},“layerCompression”: {"\_enum": “encoding”,"\_value": “RLE”}},“in”: {"\_path": filePath + “\\” + documentTitle + “.tif”}},  
], {“synchronousExecution”: false, “modalBehavior”: “wait”})

The variable “filePath” was from the getFolder() function. I actually cut out a lot of code that Listener recorded and just kept it bare-bones.

Also, I’ve only tried this on Windows. I don’t know yet if it works on Mac. Would be curious if this works on Mac also if anyone tries it.

---

<div class="post-metadata">

**Author:** ![ddbell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ddbell/32/1030_2.png) [@ddbell](https://forums.creativeclouddeveloper.com/u/ddbell)\
**Post date:** [December 10, 2020, 6:43pm UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221/7 "2020-12-10T18:43:29Z")

</div>

That is pretty much exactly what I already tried. I tried again with your exact function and still it won’t save on my PC. Is this how you are getting the filePath?

```
    var saveFolder = await require("uxp").storage.localFileSystem.getFolder();
    var filePath = saveFolder.nativePath;
```

---

<div class="post-metadata">

**Author:** ![AnthonyK](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@AnthonyK](https://forums.creativeclouddeveloper.com/u/AnthonyK)\
**Post date:** [December 10, 2020, 6:57pm UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221/8 "2020-12-10T18:57:59Z")

</div>

var filePath = await require(“uxp”).storage.localFileSystem.getFolder()

---

<div class="post-metadata">

**Author:** ![ddbell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ddbell/32/1030_2.png) [@ddbell](https://forums.creativeclouddeveloper.com/u/ddbell)\
**Post date:** [December 10, 2020, 7:19pm UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221/9 "2020-12-10T19:19:19Z")

</div>

`var filePath = await require("uxp").storage.localFileSystem.getFolder();`

This will assign a folder object containing the name, type and nativePath to filePath. So how are you passing the text string to your function? I tried just passing the entire object as you are indicating but that doesn’t work for me. It seems you should need to pass filePath.nativePath which is the text string of the file path. Anyway, nothing works for me and I am wondering if it is a folder permission thing because of the UXP restrictions which may be working differently on my computer or something along those lines. Although saving jpg, png and psd through the DOM works with the same folder… so I don’t really understand.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/2X/9/9c6983e6fd7062f4fb6524b6315c056eeb7536f5.png)

---

<div class="post-metadata">

**Author:** ![ddbell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ddbell/32/1030_2.png) [@ddbell](https://forums.creativeclouddeveloper.com/u/ddbell)\
**Post date:** [December 10, 2020, 7:38pm UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221/10 "2020-12-10T19:38:52Z")

</div>

For testing, I also tried recording a function in Alchemist and using “as is” with the save file path directly embedded in the function and not using any function parameters. Then I used the getFolder() to bring up the folder picker before the save function runs to select the same folder. That didn’t work either. So it seems like it is either a bug or an issue with my specific system.

---

<div class="post-metadata">

**Author:** ![AnthonyK](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@AnthonyK](https://forums.creativeclouddeveloper.com/u/AnthonyK)\
**Post date:** [December 10, 2020, 7:51pm UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221/11 "2020-12-10T19:51:24Z")

</div>

OK, I had to check. Looks like I used filePath.name for the filePath variable. Try that maybe instead of “.nativePath” though they look identical, so I’m not sure why .name works.

I also save this filePath.name variable to local storage and then retrieve it when I actually need to use it. Maybe that helps.

---

<div class="post-metadata">

**Author:** ![ddbell](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/ddbell/32/1030_2.png) [@ddbell](https://forums.creativeclouddeveloper.com/u/ddbell)\
**Post date:** [December 10, 2020, 8:01pm UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221/12 "2020-12-10T20:01:37Z")

</div>

Thanks for your help. I tried .name too already. I also save it to a variable first.

However, I already hardcoded the path in the function to test in order to bypass the variable which didn’t work either. I’m pretty certain that what I have tried should work. My gut feeling is it is a folder permission issue related to the new UXP folder security. Not sure why the DOM works and not the batchPlay function though. Anyway, I think I will just put tif on ice for now and wait for more instruction in the docs for how to use tif with the DOM and then try again later.

---

<div class="post-metadata">

**Author:** ![AnthonyK](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@AnthonyK](https://forums.creativeclouddeveloper.com/u/AnthonyK)\
**Post date:** [December 10, 2020, 8:48pm UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221/13 "2020-12-10T20:48:22Z")

</div>

I also had a problem initially too. I got a Photoshop program error. However, when I restarted PS, it worked. I’ve also only tested this on the pre-release version. Maybe the product version doesn’t support it.

---

<div class="post-metadata">

**Author:** ![4Loren](https://avatars.discourse-cdn.com/v4/letter/4/7cd45c/32.png) [@4Loren](https://forums.creativeclouddeveloper.com/u/4Loren)\
**Post date:** [April 14, 2021, 8:39pm UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221/14 "2021-04-14T20:39:26Z")

</div>

The posting is a couple months old but maybe this is valid. I picked this up from a similar forum and use it in a function.

var doc = app.activeDocument;  
var fName = doc.name;

function SaveTif(fName) {  
var Path = doc.path;  
var tifOpts = new TiffSaveOptions();  
tifOpts.embedColorProfile = true; //or false  
tifOpts.imageCompression = TIFFEncoding.TIFFLZW;  
tifOpts.alphaChannels = false; //or false  
tifOpts.byteOrder = ByteOrder.IBM;  
tifOpts.layers = false; // or true  
doc.saveAs((new File(Path + “/” + fName)), tifOpts, true, Extension.LOWERCASE);  
};

---

<div class="post-metadata">

**Author:** ![Pierre\_G](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/pierre_g/32/971_2.png) [@Pierre\_G](https://forums.creativeclouddeveloper.com/u/Pierre_G)\
**Post date:** [April 14, 2021, 8:47pm UTC](https://forums.creativeclouddeveloper.com/t/where-to-find-list-of-save-options/2221/15 "2021-04-14T20:47:33Z")

</div>

@4Loren I’m afraid that’s for CEP JS. This code is not valid when working with UXP JS…
