Reorganize code in asmake.applescript.