Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Controlling ScreenShots
-
No, there isn't. Screenshots are an iOS feature that isn't available to apps. The only way you can take screenshots is manually by holding the home button and pressing the lock button.
-
The iOS app iCab mobile lets you make a screenshot from a menu item, so this is possible from within an app.
-
...with one exception: It's possible to create screenshots of your own UI:
import ui def screenshot_action(sender): v = sender.superview with ui.ImageContext(v.width, v.height) as c: v.draw_snapshot() c.get_image().show() v = ui.load_view() v.present('sheet')
(To use this, create a script with UI, add a button or something like that, and set its action to
screenshot_action
. The result will be shown in the console, from where you could save it to your photos etc. If you run this on an iPhone, you'll need to close the UI to see it. And yes, I know that this method is not documented... Sorry about that. It's probably not what the OP was asking about anyway, but could still be useful sometimes.) -
Ok, thanks. I was thinking of making a screen recorder
-
@omz I tried your script, but it shows a blank sheet. I close it and it shows the co sole view
-
Have you actually added anything in the UI editor?
-
... no
-
@omz What would I add
-
reefboy1: what do you want to take screenshots of?
-
@0942v8653 anything for now
-
Any suggestions?
-
The workflow app lets you delete screenshots
-
@dalacv I'm not trying to delete them, I'm trying to Make them. I also would like to use pythonista built in functions, not workflows
-
Step by step:
- Create a new "Script with UI"
- In the script part, paste the code above
- In the UI part, add some elements (e.g. an ImageView etc.)
- Add a button to the UI, open the inspector ("i" button) and set its
action
attribute toscreenshot_action
. - Run the script, tap the button you added, the screenshot should appear in the console
Note that this will only make a screenshot of the UI you created yourself. As I said, it's not terribly useful, not what you actually wanted, and you can't make a screenshot of the entire app, your homescreen or whatever else this way...
-
@omz thank you so much. I love your apps.
-
Ok my last question is: When I hit the button is it possible to make the devise keep taking screenshots until I click it again?
-
Clicking the button saves three screenshots to the local directory.
This script builds its UI at runtime so it requires no .pyui file.
https://github.com/cclauss/Pythonista_ui/blob/master/ScreenshotView.py
-
Ok cool, thanks
-
@ccc when I run your script nothing happens, it just shows the console screen
-
When I click the button is it possible to take the screenshot 3 times in 1 click???