@@ -0,0 +1,1433 @@
+import datetime, ui%0A%0Aclass ScreenshotView(ui.View):%0A    def __init__(self):%0A        self.width = 300%0A        self.add_subview(self.make_button())%0A        self.add_subview(self.make_textview())%0A        self.present('sheet')%0A%0A    def get_shapshot(self):%0A        with ui.ImageContext(self.width, self.height) as context:%0A                self.draw_snapshot()%0A                return context.get_image()%0A%0A    def screenshot_action(self, sender):%0A        print('Saving screenshots at:')%0A        for i in xrange(3):  # save three screenshots in a row%0A            now = str(datetime.datetime.now())%0A            print('%3E ' + now)%0A            self%5B'textfield'%5D.text = now%0A            filename = 'Screenshot_%7B%7D.png'.format(now.replace(' ', '_'))%0A            with open(filename, 'wb') as out_file:%0A                out_file.write(self.get_shapshot().to_png())%0A%0A    def make_button(self):%0A        button = ui.Button(name='button', title='Save three screenshots')%0A        button.action = self.screenshot_action%0A        button.width  = self.width%0A        return button%0A%0A    def make_textview(self):%0A        tf = ui.TextField(name='textfield', frame=self.bounds)%0A        offset = self%5B'button'%5D.height%0A        tf.y      += offset%0A        tf.height -= offset%0A        tf.border_color = (0, 0, 1)%0A        tf.border_width = 2%0A        tf.alignment = ui.ALIGN_CENTER%0A        tf.text = str(datetime.datetime.now())%0A        return tf%0A%0Aview = ScreenshotView()%0A

Create ScreenshotView.py