---
url: /flow/guide/scripting-reference/functions/file/makeuniquefilename.md
---

# MakeUniqueFilename

## Declaration

`Function MakeUniqueFilename( aFilename : string) : string`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
  Value := MakeUniqueFilename(Source.FileCon.CurrentFilename);
end;
```

## Description

Checks to ensure the provided file name is unique. If the name is not unique it will add a number to the end of the filename portion to make it unique.
