# More Functionality in runScript

**URL:** <https://forum.inductiveautomation.com/t/more-functionality-in-runscript/7407>\
**Category:** Ignition\
**Created:** [October 14, 2013, 1:01pm UTC](https://forum.inductiveautomation.com/t/more-functionality-in-runscript/7407 "2013-10-14T13:01:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlangdon](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mlangdon](https://forum.inductiveautomation.com/u/mlangdon)\
**Post date:** [October 14, 2013, 1:01pm UTC](https://forum.inductiveautomation.com/t/more-functionality-in-runscript/7407/1 "2013-10-14T13:01:46Z")

</div>

So I see from this thread:

[viewtopic.php?f=70&t=11069](http://inductiveautomation.com/forum/viewtopic.php?f=70&t=11069)

that we’ll have global script modules in 7.7, which I am all for.

Additionally, I’d be happy to see an overloaded version of runScript() that looks something like this:

```auto
runScript("pythonFunctionName", *args)
```

Essentially, the ability to pass arguments as either enumerated arguments or as a list to a python function. And then on the Python end, the equivalent of command line arguments:

```auto
sys.argv[1]
```

Probably to simplify things it would be `runScript("functionName", list)`

and the python function

`def functionName(lst):
    someVar = lst[1]
    etc...`

It would then be up to the Expression implementation actually construct the function call.

Edit:

To explain why I want this feature… passing in arguments with the current runScript() function can be pretty convoluted, especially if they are coming from a tag. This would make that process cleaner and more readable.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [October 14, 2013, 2:59pm UTC](https://forum.inductiveautomation.com/t/more-functionality-in-runscript/7407/2 "2013-10-14T14:59:51Z")

</div>

I’d like a way to pass in a window name/path into runScript without hard coding it.

Often I want to run a function in runScript that applies to a specific window, but there’s no way to refer to the window without hardcoding it in runScript or in the function. If the window name or path changes then it doesn’t work anymore.

---

<div class="post-metadata">

**Author:** ![mlangdon](https://avatars.discourse-cdn.com/v4/letter/m/d9b06d/32.png) [@mlangdon](https://forum.inductiveautomation.com/u/mlangdon)\
**Post date:** [October 16, 2013, 3:03pm UTC](https://forum.inductiveautomation.com/t/more-functionality-in-runscript/7407/3 "2013-10-16T15:03:27Z")

</div>

@nmudge I think my suggestion would get you most of the way there. My args would usually take the form of a reference to a tag that is dynamically derived.
