How to count amount of each dice result?

Trying to work out how to best roll something for PTU, where you have to potentially roll a few dozen d6s at once and count how many of each number you get. Current solution is to just sort them to make counting easier, but if there's a way to turn something like 30d6 into a set of 6 numbers for how much of each was rolled it would be quite convenient. The roll being used right now is /r [[{?{Dowsing}d6!}>4]]d6s if it's any aid.
1512680034
You current method is the best you can get without an API script.