Skip to content

Instantly share code, notes, and snippets.

@putnamhill
Last active October 8, 2015 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save putnamhill/3306853 to your computer and use it in GitHub Desktop.
Save putnamhill/3306853 to your computer and use it in GitHub Desktop.
A bash version of the genUID.app CLSID generator for Adobe Director MOA classes.
#!/bin/bash
# genUID.sh - A bash version of the genUID.app CLSID generator for Adobe Director MOA classes.
openssl rand -hex 16 | awk '{
printf "DEFINE_GUID(CLSID(CRegister), 0x%sL, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s);\n",
substr($0, 1, 8), substr($0, 9, 4), substr($0, 13, 4), substr($0, 17, 2),
substr($0, 19, 2), substr($0, 21, 2), substr($0, 23, 2), substr($0, 25, 2),
substr($0, 27, 2), substr($0, 29, 2), substr($0, 31, 2)
}' | \
# 1st print to console...
tee -a /dev/tty | \
# ...then put a copy on the clipboard
pbcopy
echo '(a copy of this CLSID is on the clipboard)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment