Question: Is there a way to export a document in Photoshop using an action that would preserve the file name? Example: I have a document called `Home.psd`. I'd like to run an action, and it would create a `Home.png` in some specified location, like the Desktop. I can do all of this pretty easily by recording the action, except to set the save destination and file type, I must enter a name.

Answer: 
I ended up making my own script based on advice from [plainclothes](https://graphicdesign.stackexchange.com/a/17433/9906) and a link from [Joonas](https://graphicdesign.stackexchange.com/questions/17432/an-action-to-export-a-photoshop-document-with-file-name-intact?noredirect=1#comment23563_17432)

You can find the script here: <https://github.com/edwardloveall/Photoshop-Export-PSD-script>

By default, it saves to the Desktop, but just edit the line

```
var desktop               = '~/Desktop';

```

to change the destination.
You can [create an action](https://graphicdesign.stackexchange.com/questions/29927/creating-action-using-photoshop) to save the images as you want and then simply use this action in the "batch" command found in the menu "file" then "automate"

There you can choose what folder to use for the images you want to process, and also WHERE you want them to be saved.

You can also simply select the "extension" as shown in the screenshot below; it will save your image with the same name, but will add the right extension.

[![Automate Batch](https://i.stack.imgur.com/vEFcx.jpg)](https://i.stack.imgur.com/vEFcx.jpg)