Tapatalk

GUID generator method for UE scripts

GUID generator method for UE scripts

4
NewbieNewbie
4

    Mar 09, 2011#1

    I very much need to call the GUID generator within a script, but could not find a method listed in the help for scripts, nor here in the forums.

    I did see a reference to a function "com_create_guid", but this doesn't seem to be a javascript method in the UltraEdit class.

    Any suggestions are welcome.

    6,685587
    Grand MasterGrand Master
    6,685587

      Mar 09, 2011#2

      In Save all new, unnamed files with automatically generated file names there is a script posted by a user who used a GUID generating function to build unique file names, see the 2 functions S4() and guid().

      4
      NewbieNewbie
      4

        Mar 10, 2011#3

        Thanks, Mofi!

        Since the forum searches don't seem to look within code snippets, I'll repost them here, just so anyone can find them a little easier. They are:

        function S4() {
           return (((1+Math.random())*0x10000)|0).toString(16).substring(1);
        }
        function guid() {
           return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4());
        }


        Originally posted here: Save all new, unnamed files with automatically generated file names

        Kudos to "fredtheman".