# Moving script from project library to shared library is giving me an error

**URL:** <https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664>\
**Category:** Ignition\
**Tags:** scripting, ignition79\
**Created:** [July 20, 2023, 4:54pm UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664 "2023-07-20T16:54:28Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alexandre\_Riebel](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Alexandre\_Riebel](https://forum.inductiveautomation.com/u/Alexandre_Riebel)\
**Post date:** [July 20, 2023, 4:54pm UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664/1 "2023-07-20T16:54:28Z")

</div>

I recently moved a script that I was working on from the project script library to the shared script library, and I am now getting the following error when I try to call the function from the script console:

AttributeError: 'com.inductiveautomation.ignition.designer.gui.tool' object has no attribute '_SCRIPT NAME_'

I know that by moving it from the project library to the shared library I am changing the scope from project to gateway, but the only system functions I am using in my script are system.tag.readAll and system.tag.writeAll. I am also importing python's threading module. I am wondering if maybe you cannot import python modules in gateway scoped scripts? Has anyone encountered anything like this before?

---

<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:** [July 20, 2023, 5:09pm UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664/2 "2023-07-20T17:09:19Z")

</div>

> [@Alexandre\_Riebel](#):
>
> changing the scope from project to gateway

No, neither `project.*` nor `shared.*` scripts have a scope of their own. They run in whatever scope calls them. The `shared.*` scripts just happen to be the only ones available to gateway global scope.

Look for a syntax error or some other problem. Closely examine your logs, and make sure you've saved your project(s).

---

<div class="post-metadata">

**Author:** ![Alexandre\_Riebel](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Alexandre\_Riebel](https://forum.inductiveautomation.com/u/Alexandre_Riebel)\
**Post date:** [July 20, 2023, 5:21pm UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664/3 "2023-07-20T17:21:34Z")

</div>

I copy pasted it exactly from the project library so I have the exact same script in both the project library and the shared library. When I call the one in the project library, it works perfectly, but the one in the shared library throws an error.

---

<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:** [July 20, 2023, 5:22pm UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664/4 "2023-07-20T17:22:49Z")

</div>

Show your calling code. Describe where it is. Show the complete error. Show any errors you have in your log/console.

---

<div class="post-metadata">

**Author:** ![Alexandre\_Riebel](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Alexandre\_Riebel](https://forum.inductiveautomation.com/u/Alexandre_Riebel)\
**Post date:** [July 20, 2023, 5:29pm UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664/5 "2023-07-20T17:29:35Z")

</div>

Sure, I am calling both from the designer's script console.  
Here is how I am calling the script from the shared library:

```auto
plant_id = '257'
process_id = '322'
shared.SYS_20_advanced_controls.mod_50.multiplex_mpc_params(plant_id, process_id)

```

Here is how I am calling the script from the project library:

```auto
plant_id = '257'
process_id = '322'
project.MPC_Params.multiplex_mpc_params(plant_id, process_id)

```

For both of those, I right clicked on the function and pressed "Copy Full Path" to ensure that I am getting the correct path to the function.  
Here is the full error from the script console:

```auto
Traceback (most recent call last):
  File "<buffer>", line 3, in <module>
AttributeError: 'com.inductiveautomation.ignition.designer.gui.tool' object has no attribute 'multiplex_mpc_params'

```

---

<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:** [July 20, 2023, 5:36pm UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664/6 "2023-07-20T17:36:25Z")

</div>

Hmm. Restarted your designer?

---

<div class="post-metadata">

**Author:** ![Alexandre\_Riebel](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Alexandre\_Riebel](https://forum.inductiveautomation.com/u/Alexandre_Riebel)\
**Post date:** [July 20, 2023, 5:47pm UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664/7 "2023-07-20T17:47:20Z")

</div>

I just tried that - no luck. BTW, thanks for the help, much appreciated. It seems to think that my 'mod\_50' script is a 'com.inductiveautomation.ignition.designer.gui.tool' object... That doesn't seem right. Just to be clear, SYS\_20\_advanced\_controls is a package, then mod\_50 is a script in that package, and multiplex\_mpc\_params is a function in that script.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 20, 2023, 5:51pm UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664/8 "2023-07-20T17:51:40Z")

</div>

What 7.9 version? This feels a bit familiar, but it's also been a long time since any 7.9 version was released.

The slightly weird type is because the script console wraps things up for internal reasons.

---

<div class="post-metadata">

**Author:** ![Alexandre\_Riebel](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Alexandre\_Riebel](https://forum.inductiveautomation.com/u/Alexandre_Riebel)\
**Post date:** [July 20, 2023, 7:42pm UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664/9 "2023-07-20T19:42:07Z")

</div>

We're on 7.9.18.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [July 20, 2023, 7:43pm UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664/10 "2023-07-20T19:43:44Z")

</div>

Does it work from a vision button, out of curiosity?

---

<div class="post-metadata">

**Author:** ![Alexandre\_Riebel](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Alexandre\_Riebel](https://forum.inductiveautomation.com/u/Alexandre_Riebel)\
**Post date:** [July 20, 2023, 7:54pm UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664/11 "2023-07-20T19:54:56Z")

</div>

It just tested it and it did not work. It gave me a similar error:

```auto
Traceback (most recent call last):

  File "<event:actionPerformed>", line 1, in <module>

AttributeError: 'com.inductiveautomation.ignition.common.script.Scr' object has no attribute 'multiplex_mpc_params'

```

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [July 20, 2023, 8:00pm UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664/12 "2023-07-20T20:00:09Z")

</div>

I've seen this when a code error or indentation error prevents the library from compiling properly.  
Look for any red lines in the script editor.

---

<div class="post-metadata">

**Author:** ![Alexandre\_Riebel](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Alexandre\_Riebel](https://forum.inductiveautomation.com/u/Alexandre_Riebel)\
**Post date:** [July 20, 2023, 8:37pm UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664/13 "2023-07-20T20:37:19Z")

</div>

I copy-pasted it from the project library where it was working fine, and I just double-checked it and do not see any of those types of errors.

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [July 21, 2023, 12:53am UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664/14 "2023-07-21T00:53:00Z")

</div>

I know you said you saved the project, but have you published the changes since this is 7.9?

Mike

---

<div class="post-metadata">

**Author:** ![Alexandre\_Riebel](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@Alexandre\_Riebel](https://forum.inductiveautomation.com/u/Alexandre_Riebel)\
**Post date:** [July 21, 2023, 5:24pm UTC](https://forum.inductiveautomation.com/t/moving-script-from-project-library-to-shared-library-is-giving-me-an-error/76664/15 "2023-07-21T17:24:19Z")

</div>

Yes I saved and published. I've got an update however: I tried the exact same thing on a different gateway (different site) running the same version of ignition and it worked. Seems like there is something buggy about the specific gateway that I was using at the time. All other gateways I have tried so far have worked.
