Generate a UUID For Use in XML?
Generate a UUID For Use in XML?
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.
Re: Generate a UUID For Use in XML?
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)
- 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)
-
- Member
- Posts: 93
- Joined: Fri Jul 08, 2011 10:31 am
- Location: The Netherlands
Re: Generate a UUID For Use in XML?
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
See: http://www.enfocus.com/manuals/Develope ... /home.html