/* Function: uuid Generates a time-based UUID string . Parameters: c - (optional) true to use your computers MAC code (default: false) Returns: A UUID string. About: License - Version 1.1 - Dedicated to the public domain (CC0 1.0) http://www.autohotkey.com/board/topic/13636-universally-unique-identifier-uuidguid-generator/ */ Gui, Add, Text, x20 y20 w250 h40 , Dette programmet produserer en txt fil med UUID, og kan knytte en PURL til disse Gui, Add, Text, r1 x20 y80 w140 h20 , Antall UUID som skal lages: Gui, Add, Edit, r1 x160 y80 w150 h30 v$PURL , http://purl.org/nhmuio/id/ ;Gui, Add, Button, x350 y80 w100 h30 , Lag UUID Gui, Add, Text, r1 x20 y150 w140 h20 , Antall UUID som skal lages: Gui, Add, Edit, r1 x160 y150 w100 h30 v$antall, 10 Gui, Add, Button, x290 y140 w100 h50 gLAGUUID, Lag UUID ; Generated using SmartGUI Creator 4.0 Gui, Show, x130 y90 h259 w450, UUID generator Return LAGUUID: Gui, submit, NoHide FileDelete, uuid.txt loop, %$antall% { uuid(c = false) { static n = 0, l, i f := A_FormatInteger, t := A_Now, s := "-" SetFormat, Integer, H t -= 1970, s t := (t . A_MSec) * 10000 + 122192928000000000 If !i and c { Loop, HKLM, System\MountedDevices If i := A_LoopRegName Break StringGetPos, c, i, %s%, R2 StringMid, i, i, c + 2, 17 } Else { Random, x, 0x100, 0xfff Random, y, 0x10000, 0xfffff Random, z, 0x100000, 0xffffff x := 9 . SubStr(x, 3) . s . 1 . SubStr(y, 3) . SubStr(z, 3) } t += n += l = A_Now, l := A_Now SetFormat, Integer, %f% Return, SubStr(t, 10) . s . SubStr(t, 6, 4) . s . 1 . SubStr(t, 3, 3) . s . (c ? i : x) } ;MsgBox, % uuid(false) ; gives [color=olive]1cb54630-955b-126a-957f-1a3b935c8fa8[/color] nr := % uuid(false) FileAppend ,%$PURL%%nr% `n, uuid.txt } MsgBox OK Run, %A_ScriptDir% return GuiClose: ExitApp