In continued efforts by YoYo to render my old tutorial work entirely obsolete you can now automatically create nine slices in version 2.3.2 without any scripting whatsoever!
In version 2.3.2 (currently in beta, due for imminent release) you can define nine slices on a sprite by sprite basis and even set the repeat/stretch settings for each individual edge!
You can also rotate them and all sorts. Watch the video. It's cool.
(There's a special credits sequence at the end of this video, keep an eye out.)