Applescript for "Convert to project"?

I’ve been playing around with Applescript + OF recently, and I’ve been struck by the lack of a “Convert to project” command on tasks. As a result, any projects trying to replicate this need to effectively create a new project, copy over all the notes, etc., and then shift the tasks across. Anyone know of a nicer way to convert a task to a project in Applescript than this method?