# Read the opc Item Path using script

**URL:** <https://forum.inductiveautomation.com/t/read-the-opc-item-path-using-script/37037>\
**Category:** Ignition\
**Tags:** ignition78, ignition79, scripting\
**Created:** [July 24, 2020, 9:30am UTC](https://forum.inductiveautomation.com/t/read-the-opc-item-path-using-script/37037 "2020-07-24T09:30:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarun89engg](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@tarun89engg](https://forum.inductiveautomation.com/u/tarun89engg)\
**Post date:** [July 24, 2020, 9:30am UTC](https://forum.inductiveautomation.com/t/read-the-opc-item-path-using-script/37037/1 "2020-07-24T09:30:22Z")

</div>

HI all,

I would like to ge the opc item path same like in OPC tag browser has a column OPC Item Path.

I have tried following script in script console

```auto
import system.tag

server = "Ignition OPC-UA Server"
 
folderPath1 = "*Tags Ignition OPC UA/AAT/DB950 DB951/AAT Prägung SPS*"
 
OpcObjects = system.opc.browse(opcServer=server,folderPath=folderPath1)
 

for address in OpcObjects:
    print address.getOpcItemPath()

```

it returns me following output.

```auto
ns=2;s=[default]Tags Ignition OPC UA/AAT/DB950 DB951/AAT Prägung SPS
ns=2;s=[default]Tags Ignition OPC UA/AAT/DB950 DB951/AAT Prägung SPS/Farbcode

```

What i would like to have is for those tags the opc item path same as tag browser.

```auto
[AAT SPS]DB918,STRING38.4
[AAT SPS]DB918,STRING18.8

```

How i can get all the address in OPC UA server as above.  
any help is greatly appreciated.

Regads,  
tar

---

<div class="post-metadata">

**Author:** ![tarun89engg](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@tarun89engg](https://forum.inductiveautomation.com/u/tarun89engg)\
**Post date:** [July 24, 2020, 10:12am UTC](https://forum.inductiveautomation.com/t/read-the-opc-item-path-using-script/37037/2 "2020-07-24T10:12:12Z")

</div>

I got the solution.

```auto
import system.tag

server = "Ignition OPC-UA Server"
 
folderPath1 = "Tags Ignition OPC UA/AAT/DB950 DB951"
 
tags = system.tag.browseTags(parentPath=folderPath1,recursive=True)
for tag in tags:
	if tag.isOPC():
		print system.tag.getAttribute(tag.path, "OPCItemPath")

```

regards,  
tar
