Parse direct types from AppleScripts

Plus: Comments, tidy-up and DRY