Generate a UUID For Use in XML?

Post Reply
rgpepper
Member
Posts: 80
Joined: Wed Oct 14, 2015 2:09 am

Generate a UUID For Use in XML?

Post by rgpepper »

I need to provide a UUID in an XML file I'm thinking I'll be able to generate using "Make XML". But I'm not seeing anything about actually generating one within (and for use within) Switch.
Padawan
Advanced member
Posts: 358
Joined: Mon Jun 12, 2017 8:48 pm
Location: Belgium
Contact:

Re: Generate a UUID For Use in XML?

Post by Padawan »

Switch doesn't provide any functionality to create UUID's that I'm aware of. Possible solutions I see are:

- Write functionality in Switch Javascript to create them (based on Math.Random())
The following page can give some inspiration:
https://stackoverflow.com/questions/105 ... javascript

- Use a command line tool to generate the UUID and get the communicate with the command line tool via Switch Javascript
On mac you can run the pre-installed "uuidgen" command
On Windows you can try to use something like this:
POWERSHELL -COMMAND "$([guid]::NewGuid().ToString())"
(I have not tested this command in Switch yet, you might need to have the full path to powershell)
r.zegwaard
Member
Posts: 93
Joined: Fri Jul 08, 2011 10:31 am
Location: The Netherlands

Re: Generate a UUID For Use in XML?

Post by r.zegwaard »

WIth the global data in a switch-script, you can quite easy create counter as a uuid.
See: http://www.enfocus.com/manuals/Develope ... /home.html
Post Reply