# Mouse click tag write

**URL:** <https://forum.inductiveautomation.com/t/mouse-click-tag-write/17935>\
**Category:** Ignition\
**Created:** [May 6, 2018, 3:45pm UTC](https://forum.inductiveautomation.com/t/mouse-click-tag-write/17935 "2018-05-06T15:45:11Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [May 6, 2018, 10:11pm UTC](https://forum.inductiveautomation.com/t/mouse-click-tag-write/17935/21 "2018-05-06T22:11:44Z")

</div>

Yes, the return would work inside a function (which you could do using “def”). Or you could do it like this (after all the elifs):

```auto
if equipmentChoice == -1:
   system.gui.messageBox("You must choose the equipment before writing a value", "Choose equipment")
else:
   system.tag.write(tagName, value)

```

When you’re scripting, if you’re not familiar with Python but hopefully are familiar with some programming language, just search “Python [whatever it is you’d use in the language you’re familiar with]” and you should find examples of how to create the logic you’re looking for in Python.

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [May 6, 2018, 10:15pm UTC](https://forum.inductiveautomation.com/t/mouse-click-tag-write/17935/22 "2018-05-06T22:15:32Z")

</div>

I am new to the scripting side. Trying to learn as I go. still no tag write.

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [May 6, 2018, 10:17pm UTC](https://forum.inductiveautomation.com/t/mouse-click-tag-write/17935/23 "2018-05-06T22:17:29Z")

</div>

but no error on tagName!

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [May 6, 2018, 10:18pm UTC](https://forum.inductiveautomation.com/t/mouse-click-tag-write/17935/24 "2018-05-06T22:18:47Z")

</div>

As a rule, if your script isn’t working, break it down into parts and test them to find out where it is failing. And/or add print/system.gui.messageBox along the way to check values as you did above.

If you’re still clearing selectedValue in the dropdown before you read it in this script (getting -1 in script), it is expected that this script will not write a tag. Without a valid selection from dropdown it doesn’t know what tag to write to.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [May 6, 2018, 10:23pm UTC](https://forum.inductiveautomation.com/t/mouse-click-tag-write/17935/25 "2018-05-06T22:23:11Z")

</div>

If you’re not familiar with any scripting language (hard for me to relate as I was coding in basic on a monochrome computer with a few KB of memory when 6 years old), you’ll likely still have some luck finding what you’re looking for by searching the internet for “How to \_\_\_\_\_\_\_\_\_ Python”. Any scripting in Ignition besides SQL statements will be Python and Java. As they are common outside Ignition, much of what you need will be found from other sources.

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [May 6, 2018, 10:27pm UTC](https://forum.inductiveautomation.com/t/mouse-click-tag-write/17935/26 "2018-05-06T22:27:42Z")

</div>

ok, Thanks for all the Help. It is working now! II have been doing PLC programming for several years now. Since getting Ignition it has opened a whole new world of programming Sql and Python.

---

<div class="post-metadata">

**Author:** ![witman](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@witman](https://forum.inductiveautomation.com/u/witman)\
**Post date:** [May 6, 2018, 10:32pm UTC](https://forum.inductiveautomation.com/t/mouse-click-tag-write/17935/27 "2018-05-06T22:32:04Z")

</div>

Cool; glad you’ve got it working. Python and Java were new to me with Ignition, but with a few pointers here and realizing there’s lots of info on them elsewhere it’s possible to do just about anything in Ignition. Have fun!

---

<div class="post-metadata">

**Author:** ![jnunez](https://avatars.discourse-cdn.com/v4/letter/j/9f8e36/32.png) [@jnunez](https://forum.inductiveautomation.com/u/jnunez)\
**Post date:** [May 10, 2018, 12:38pm UTC](https://forum.inductiveautomation.com/t/mouse-click-tag-write/17935/28 "2018-05-10T12:38:08Z")

</div>

I guess you get it working, however the only thing a don’t see in the posts is the Tag Provider with the tag path. For Ignition defined tags under the default provider should look something like this.

system.tag.write(‘[default]path/to/tag’)

Hope this is useful in any future needs.

[Previous page](https://forum.inductiveautomation.com/t/mouse-click-tag-write/17935.md?page=1)
