# Screenshot Using Robot().CreateScreenCapture

**URL:** <https://forum.inductiveautomation.com/t/screenshot-using-robot-createscreencapture/116401>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [July 14, 2026, 4:35pm UTC](https://forum.inductiveautomation.com/t/screenshot-using-robot-createscreencapture/116401 "2026-07-14T16:35:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ryan.white](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryan.white/32/73193_2.png) [@ryan.white](https://forum.inductiveautomation.com/u/ryan.white)\
**Post date:** [July 14, 2026, 4:43pm UTC](https://forum.inductiveautomation.com/t/screenshot-using-robot-createscreencapture/116401/2 "2026-07-14T16:43:50Z")

</div>

It looks like you have cut off part of your code at the bottom, post code, not pictures of code. Please see [Wiki - how to post code on this forum](https://forum.inductiveautomation.com/t/wiki-how-to-post-code-on-this-forum/77831).

Other points of note:  
-This doesn't appear to be a project library script, as I'm not seeing any function `def` anywhere.  
-Don't use `exit()`, full stop. If you need to exit your logic early, put your logic in a function in the project library and use `return`. Call said function from your button.  
-Ignition provides built in methods for both reading and writing to files. Use `system.file.writeFile` instead of `ImageIO.write`.  
-In general, use built in Ignition methods before deferring to java or python packages (especially with times/dates).

---

_[View the full topic](https://forum.inductiveautomation.com/t/screenshot-using-robot-createscreencapture/116401)._
