Une a unique nome on name files

Hi all.
I need to generate a long list of files: every files have to be a different and unique name. I thanked about date for generating name.
I tried to use

set myVar to do shell script "date"

but the result is “Gio 4 Mag 2017 15:39:32 CEST” and I cannot use charter “:” on names.

So I change and I start to study “date” command. A good idea is to use something like this

set myVar to do shell script "date '+%n%Y%n%A%n%H%n%M%n%S'"

but the result have some “enter” charter that are not good.
Does anyone know a way to have a unique name via terminal or AS without strange charters?

Tnx in advance

Hi, one solution:

Greetz, Eric

The enter characters are the %n format specifiers.

I recommend

set myVar to do shell script "date '+%Y%m%d_%H%M%S'"

which is 20170504_161907 for 2017 May 04 16:19:07

Colons ( : ) are not recommended because they are path separators in the Finder. But you could use dots.

set myVar to do shell script "date '+%Y.%m.%d_%H.%M.%S'"

Or you can use the Cocoa NSUUID class

use framework "Foundation"

set uniqueString to current application's NSUUID's UUID()'s UUIDString() as text

You will get an unique string like 5401E29C-AA93-4849-90A2-D44B3F5773B1

Thnx to everyone