# Cannot specify file type:app.activeDocument.save

**URL:** <https://forums.creativeclouddeveloper.com/t/cannot-specify-file-type-app-activedocument-save/4890>\
**Category:** Photoshop\
**Created:** [July 1, 2022, 2:51pm UTC](https://forums.creativeclouddeveloper.com/t/cannot-specify-file-type-app-activedocument-save/4890 "2022-07-01T14:51:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrL](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@MrL](https://forums.creativeclouddeveloper.com/u/MrL)\
**Post date:** [July 1, 2022, 2:51pm UTC](https://forums.creativeclouddeveloper.com/t/cannot-specify-file-type-app-activedocument-save/4890/1 "2022-07-01T14:51:17Z")

</div>

hello,

When I run the saved code, the saved file type is always PSD and cannot be changed. Is there any good way to solve it? I want to save as the specified type.

```auto
await require("photoshop").core.executeAsModal(async function (c) {

    const file = await require("uxp").storage.localFileSystem.getFileForSaving("a.png", {
        types: ["png"]
    });

    await require("photoshop").app.activeDocument.save(file, {
        embedColorProfile: true
    });
    
}, {
    "commandName": "test"
});

```

manifest v5:

```auto
  "requiredPermissions": {
    "localFileSystem": "request",
    "launchProcess": {
      "extensions": [".jpg", ".png", ".psd"]
    }

```

ps version 23.4.1,win10 x64

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [July 1, 2022, 3:01pm UTC](https://forums.creativeclouddeveloper.com/t/cannot-specify-file-type-app-activedocument-save/4890/2 "2022-07-01T15:01:12Z")

</div>

May I ask where did you find this code example? In the docs I find `getFileForSaving()` accepts only one argument (you provide two) and `save()` does not accept any at all (you provide also two)

---

<div class="post-metadata">

**Author:** ![MrL](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@MrL](https://forums.creativeclouddeveloper.com/u/MrL)\
**Post date:** [July 1, 2022, 3:23pm UTC](https://forums.creativeclouddeveloper.com/t/cannot-specify-file-type-app-activedocument-save/4890/3 "2022-07-01T15:23:15Z")

</div>

Hi,

The code I found here:

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

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [July 1, 2022, 3:25pm UTC](https://forums.creativeclouddeveloper.com/t/cannot-specify-file-type-app-activedocument-save/4890/4 "2022-07-01T15:25:03Z")

</div>

I think that’s for Ps v22. [Here’s for v23](https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/document/#save)  
Sorry, I personally didn’t have to deal with document save myself, just noticed, that methods are used differently from what docs say

---

<div class="post-metadata">

**Author:** ![MrL](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@MrL](https://forums.creativeclouddeveloper.com/u/MrL)\
**Post date:** [July 1, 2022, 3:28pm UTC](https://forums.creativeclouddeveloper.com/t/cannot-specify-file-type-app-activedocument-save/4890/5 "2022-07-01T15:28:10Z")

</div>

if I want to save as PNG or JPG, what should I do?

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [July 1, 2022, 3:36pm UTC](https://forums.creativeclouddeveloper.com/t/cannot-specify-file-type-app-activedocument-save/4890/6 "2022-07-01T15:36:29Z")

</div>

I’d try doing it with BatchPlay

> [@Saving a PNG file with UXP?](http://forums.creativeclouddeveloper.com/t/saving-a-png-file-with-uxp/3698):
>
> Is there a simple way to save a .png file of the active document in UXP? const uxp = require('uxp'); const lfs = uxp.storage.localFileSystem; const userFolder = lfs.getFolder(); const file = userFolder.createFile("test.png"); My problem boils down to the code above. I correctly get a dialog to select the folder, select eg. the desktop or c: drive, after that all I get is “createFile is not a function”. Is getFolder failing for some reason or has something changed about create…

---

<div class="post-metadata">

**Author:** ![MrL](https://avatars.discourse-cdn.com/v4/letter/m/b487fb/32.png) [@MrL](https://forums.creativeclouddeveloper.com/u/MrL)\
**Post date:** [July 1, 2022, 3:44pm UTC](https://forums.creativeclouddeveloper.com/t/cannot-specify-file-type-app-activedocument-save/4890/7 "2022-07-01T15:44:22Z")

</div>

@Karmalakas Thank you for your help.

I have found the code:

`await app. activeDocument. saveAs. jpg(entry_jpg,{ quality: 12 }, true)`

[https://developer.adobe.com/photoshop/uxp/2022/ps\_reference/classes/document/#saveas](https://developer.adobe.com/photoshop/uxp/2022/ps_reference/classes/document/#saveas)

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [July 1, 2022, 4:15pm UTC](https://forums.creativeclouddeveloper.com/t/cannot-specify-file-type-app-activedocument-save/4890/8 "2022-07-01T16:15:11Z")

</div>

I was looking there in Methods section and didn’t even notice it’s a property 🤦‍♂️ Only at Adobe someone might think of such object structure 😅
