How to create randomly generated name

Asked by Matt Pappas

Hello,
I am writing a script that runs through a loop to create several of the same object. The object name must be unique. What is an easy way to pass in a random name via the "Type" command? For example, is there a way I can type in the name based on a timestamp?

Thanks,
Matt

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

the easiest:

str(int(time.time()*1000))

this gives you a new string value every millisecond.
(based on the current time in seconds since 1970)

Revision history for this message
Matt Pappas (matt-pappas) said :
#2

Thanks RaiMan, that solved my question.