# Can't use clipboard() out REPL

**URL:** https://discourse.julialang.org/t/cant-use-clipboard-out-repl/50055
**Category:** New to Julia
**Tags:** interactiveutils
**Created:** [November 12, 2020, 3:24pm UTC](https://discourse.julialang.org/t/cant-use-clipboard-out-repl/50055 "2020-11-12T15:24:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![paulowagner1985](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paulowagner1985/32/19360_2.png) [@paulowagner1985](https://discourse.julialang.org/u/paulowagner1985)
#### Post date: [November 12, 2020, 3:24pm UTC](https://discourse.julialang.org/t/cant-use-clipboard-out-repl/50055/1 "2020-11-12T15:24:10Z")

</div>

Hey guys!

I’m having problems using clipboard() outside of the REPL…

If i make a clip.jl file with:

x = “hi”  
clipboard(x)

I get the message:  
ERROR LoadError: UndefVarError: clipboard not defined

Also with only  
clipboard()

What am i doing wrong?

Inside REPL, it works fine…

Thanks!

---

<div class="post-metadata">

### Author: ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)
#### Post date: [November 12, 2020, 3:48pm UTC](https://discourse.julialang.org/t/cant-use-clipboard-out-repl/50055/2 "2020-11-12T15:48:12Z")

</div>

Hi, welcome to the Julia Discourse forum! If you do `@which clipboard`, it shows that `clipboard` is defined in the `InteractiveUtils` module. It appears that this module is automatically loaded by the REPL but not when executing a script. So just adding `using InteractiveUtils: clipboard` at the start of your script should fix it.

I can’t find anything about this in the documentation, maybe worth investigating and fixing with a PR…

---

<div class="post-metadata">

### Author: ![paulowagner1985](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/paulowagner1985/32/19360_2.png) [@paulowagner1985](https://discourse.julialang.org/u/paulowagner1985)
#### Post date: [November 12, 2020, 4:06pm UTC](https://discourse.julialang.org/t/cant-use-clipboard-out-repl/50055/3 "2020-11-12T16:06:02Z")

</div>

Thanks a lot!  
It worked!
