Dock - MacGapProject/MacGap1 GitHub Wiki
Set the Dock's badge
macgap.dock.badge = "10";
Note that the value must be a string, and does not have to be an integer in string form.
macgap.dock.badge = "macgap";
Debugging
If the value is an integer type, Finder will crash and there will be this error on the app's console log:
[Error] Error: -[__NSCFNumber isEqualToString:]: unrecognized selector sent to instance