# Command: JoinMP3

**URL:** https://resource.dopus.com/t/command-joinmp3/18809
**Category:** Buttons/Scripts
**Tags:** script, commands, jscript
**Created:** [July 25, 2014, 12:04am UTC](https://resource.dopus.com/t/command-joinmp3/18809 "2014-07-25T00:04:49Z")
**Posts on this page:** 1
**Showing post:** 15

<div class="post-metadata">

### Author: ![fred](https://resource.dopus.com/user_avatar/resource.dopus.com/fred/32/58927_2.png) [@fred](https://resource.dopus.com/u/fred)
#### Post date: [April 13, 2015, 9:58pm UTC](https://resource.dopus.com/t/command-joinmp3/18809/15 "2015-04-13T21:58:15Z")

</div>

Thanks for the script.

Here is a sample button, the one I use:

(When pasting into the Button Editor, ensure the **Function** drop-down is set to **Standard Function (Opus or External)**. Do not set it to Script Function for this command.)

```nohighlight
@disablenosel
@filesonly
@nodeselect
@runmode:min
@nofilenamequoting

// ===============================================
// Secure step: if you have selected some files that are not mp3 this will deselect them and prevent errors from ffmpeg
// (This requires you have a proper filter set)

Select "NOT mp3" FILTER DESELECT 

// ===============================================
// This will prompt you for the name of the new mp3

@runonce:@set target={dlgstringS|New MP3 file name:|{file$|noext}}

// ===============================================
// Here you can customize the ffmpeg path (it handles alias)

@set exe=/Programs\Multimedia\ffmpeg\bin\ffmpeg.exe

// ===============================================
// Here is the final command
// Just customize it for your need
JoinMP3 TARGETFILE "{sourcepath}{$target}.mp3" PAUSEATEND false FFMPEGEXE "{$exe}"

```

Here is the "NOT mp3" filter used in command

Create a new filter and name it NOT mp3

add 1st rule such as: `type | match | file only`  
add 2d rule such as: `name | match | ~(*.mp3)` | tick Use wildcards | untick Use regular expression

---

_[View the full topic](https://resource.dopus.com/t/command-joinmp3/18809)._
