# \[SOLVED\] Update HMI Screen while script is running

**URL:** <https://forum.inductiveautomation.com/t/solved-update-hmi-screen-while-script-is-running/32857>\
**Category:** Ignition\
**Created:** [March 5, 2020, 9:24pm UTC](https://forum.inductiveautomation.com/t/solved-update-hmi-screen-while-script-is-running/32857 "2020-03-05T21:24:24Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [March 6, 2020, 3:38pm UTC](https://forum.inductiveautomation.com/t/solved-update-hmi-screen-while-script-is-running/32857/4 "2020-03-06T15:38:02Z")

</div>

Well, don't confuse background with project script. A project script can be used in both foreground (events) and background. Script modules are a way to avoid repeating oneself in code--not a control over how they are executed. Based on your description, I would certainly move that task to a function run asynchronously, and a project script is a good place to put such a function.

This sort of stuff is enough of a minefield that I created a number of wrapper functions to help, to be installed as a shared or global script. You might find this topic helpful:

> [@Update GUI via Asynchronous thread](http://forum.inductiveautomation.com/t/update-gui-via-asynchronous-thread/9666/3):
>
> Since this sort of thing pops up often, I created a set of wrappers that simplify this stuff, and allows you to directly use functions in your script modules. The wrappers take care of stuffing the arguments you supply into a temporary fuction’s default argument. For your case, try assignLater(). Nick’s example becomes: # In a script module in your project: import shutil def fileTransfer(label): path = system.file.openFile() newPath = "F:\NewFolder" shutil.copy2(path, newPath) sh…

---

_[View the full topic](https://forum.inductiveautomation.com/t/solved-update-hmi-screen-while-script-is-running/32857)._
