TIMOB-12740: Refactor script to use proper AppleScript types and iTunes idioms.