# Accessing shared script from legacy script

**URL:** <https://forum.inductiveautomation.com/t/accessing-shared-script-from-legacy-script/12265>\
**Category:** Ignition\
**Created:** [October 21, 2016, 3:17am UTC](https://forum.inductiveautomation.com/t/accessing-shared-script-from-legacy-script/12265 "2016-10-21T03:17:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ella\_ramos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ella_ramos/32/3455_2.png) [@ella\_ramos](https://forum.inductiveautomation.com/u/ella_ramos)\
**Post date:** [October 21, 2016, 3:17am UTC](https://forum.inductiveautomation.com/t/accessing-shared-script-from-legacy-script/12265/1 "2016-10-21T03:17:07Z")

</div>

Hi,

I have a function that’s under the global script and I’m trying to call it from the legacy script from a gateway timer script.

Seems like its not possible, its giving me a global name is not defined error.

Thanks,  
Ella

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [October 24, 2016, 3:05pm UTC](https://forum.inductiveautomation.com/t/accessing-shared-script-from-legacy-script/12265/2 "2016-10-24T15:05:18Z")

</div>

try putting

```auto
import shared
```

at the top.

---

<div class="post-metadata">

**Author:** ![ella\_ramos](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ella_ramos/32/3455_2.png) [@ella\_ramos](https://forum.inductiveautomation.com/u/ella_ramos)\
**Post date:** [October 27, 2016, 5:51am UTC](https://forum.inductiveautomation.com/t/accessing-shared-script-from-legacy-script/12265/3 "2016-10-27T05:51:22Z")

</div>

thanks its working
