# Scripting function to read the Project Description property

**URL:** <https://forum.inductiveautomation.com/t/scripting-function-to-read-the-project-description-property/16502>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [January 6, 2018, 9:21pm UTC](https://forum.inductiveautomation.com/t/scripting-function-to-read-the-project-description-property/16502 "2018-01-06T21:21:48Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sparkblender](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sparkblender/32/4373_2.png) [@Sparkblender](https://forum.inductiveautomation.com/u/Sparkblender)\
**Post date:** [January 6, 2018, 9:21pm UTC](https://forum.inductiveautomation.com/t/scripting-function-to-read-the-project-description-property/16502/1 "2018-01-06T21:21:48Z")

</div>

Is there a scripting function that allows reading the Project Description property, as defined under Configure–\>System–\>Projects–\>Edit–\>Project Settings–\>Description?

Thanks!

---

<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:** [January 7, 2018, 2:24pm UTC](https://forum.inductiveautomation.com/t/scripting-function-to-read-the-project-description-property/16502/2 "2018-01-07T14:24:30Z")

</div>

Try this:

```auto
from com.inductiveautomation.factorypmi.application import FPMIApp
desc = FPMIApp.getInstance().clientContext.project.description

```

---

<div class="post-metadata">

**Author:** ![Sparkblender](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sparkblender/32/4373_2.png) [@Sparkblender](https://forum.inductiveautomation.com/u/Sparkblender)\
**Post date:** [January 8, 2018, 8:56pm UTC](https://forum.inductiveautomation.com/t/scripting-function-to-read-the-project-description-property/16502/3 "2018-01-08T20:56:24Z")

</div>

Hi pturmel,

Thanks for your reply.  
I tried executing it from the Script Console, but get the following message:

```auto
> Traceback (most recent call last):
> File "<buffer>", line 2, in <module>
> AttributeError: 'com.inductiveautomation.factorypmi.application.FPM' object has no attribute 'clientContext'

```

After searching, I found the following API 7.8.1 documentation, which states that the getInstance() method has been deprecated.

[http://files.inductiveautomation.com/sdk/javadoc/ignition784rc1/com/inductiveautomation/factorypmi/application/FPMIApp.html#getInstance--](http://files.inductiveautomation.com/sdk/javadoc/ignition784rc1/com/inductiveautomation/factorypmi/application/FPMIApp.html#getInstance--)

Any idea where to find the latest API documentation?

Thanks.

---

<div class="post-metadata">

**Author:** ![Kyle\_Chase](https://avatars.discourse-cdn.com/v4/letter/k/9de0a6/32.png) [@Kyle\_Chase](https://forum.inductiveautomation.com/u/Kyle_Chase)\
**Post date:** [January 8, 2018, 11:35pm UTC](https://forum.inductiveautomation.com/t/scripting-function-to-read-the-project-description-property/16502/4 "2018-01-08T23:35:28Z")

</div>

Here is the latest SDK JavaDocs:  
[http://files.inductiveautomation.com/sdk/javadoc/ignition79/790-beta1/index.html](http://files.inductiveautomation.com/sdk/javadoc/ignition79/790-beta1/index.html)

And here is the answer to your question, but this only works from the client atm.

```auto
from com.inductiveautomation.factorypmi.application import FPMIApp
print FPMIApp.getInstance().getClientPanel().getClientContext().getProject().getDescription()

```

FPMIApp has been deprecated forever.

---

<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:** [January 9, 2018, 12:00am UTC](https://forum.inductiveautomation.com/t/scripting-function-to-read-the-project-description-property/16502/5 "2018-01-09T00:00:07Z")

</div>

Actually, there’s a 7.9.4 Javadoc; pretty sure this is the latest release:  
[http://files.inductiveautomation.com/sdk/javadoc/ignition79/794-beta1/index.html](http://files.inductiveautomation.com/sdk/javadoc/ignition79/794-beta1/index.html)

Also, you can skip `FPMIApp.getInstance()` with [BasicContainer](http://files.inductiveautomation.com/sdk/javadoc/ignition79/794-beta1/com/inductiveautomation/factorypmi/application/components/BasicContainer.html)’s `getAppContext()`, eg, from a button:  
`event.source.parent.getAppContext().getProject().getDescription()`

---

<div class="post-metadata">

**Author:** ![dion.botha](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dion.botha](https://forum.inductiveautomation.com/u/dion.botha)\
**Post date:** [May 13, 2019, 9:37pm UTC](https://forum.inductiveautomation.com/t/scripting-function-to-read-the-project-description-property/16502/6 "2019-05-13T21:37:32Z")

</div>

Thanks PGriffith, this works for the project's description:

> event.source.parent.getAppContext().getProject().getDescription()

What about the project's title?

> event.source.parent.getAppContext().getProject()

Doesn't work...

---

<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:** [May 13, 2019, 9:46pm UTC](https://forum.inductiveautomation.com/t/scripting-function-to-read-the-project-description-property/16502/7 "2019-05-13T21:46:36Z")

</div>

`event.source.parent.getAppContext().getProject().getDisplayTitle()` should work in 7.9 - it will either be the project’s title field, or just the name if the title is unspecified.

`event.source.parent.getAppContext().getProject().getTitle()` or `getName()` as appropriate should work in 8.0.

---

<div class="post-metadata">

**Author:** ![dion.botha](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dion.botha](https://forum.inductiveautomation.com/u/dion.botha)\
**Post date:** [May 13, 2019, 10:15pm UTC](https://forum.inductiveautomation.com/t/scripting-function-to-read-the-project-description-property/16502/8 "2019-05-13T22:15:01Z")

</div>

Thanks, this works from a button on the window but I cannot get it to work when a window is opened... Im using the following code on a window's internalFramActivated event handler.

> system.gui.getParentWindow(event).getComponentForPath('Root Container.projectName').text = event.source.parent.getAppContext().getProject().getDisplayTitle()  
> system.gui.getParentWindow(event).getComponentForPath('Root Container.projectDescription').text = event.source.parent.getAppContext().getProject().getDescription()

And am getting this error:

> AttributeError: 'com.inductiveautomation.factorypmi.application.FPM' object has no attribute 'getAppContext'

---

<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:** [May 13, 2019, 10:18pm UTC](https://forum.inductiveautomation.com/t/scripting-function-to-read-the-project-description-property/16502/9 "2019-05-13T22:18:15Z")

</div>

`event.source.parent` is how you go from a component to its parent, meaning the root container of the window it’s on (assuming you’re not using groups or containers, anyways) - but if you’re running the code and you’re already _on_ a window/root container, then going up to `.parent` is giving you an object that doesn’t contain the method `getAppContext()`. Try swapping in `event.source.rootContainer.getAppContext()`.

---

<div class="post-metadata">

**Author:** ![dion.botha](https://avatars.discourse-cdn.com/v4/letter/d/46a35a/32.png) [@dion.botha](https://forum.inductiveautomation.com/u/dion.botha)\
**Post date:** [May 13, 2019, 10:21pm UTC](https://forum.inductiveautomation.com/t/scripting-function-to-read-the-project-description-property/16502/10 "2019-05-13T22:21:23Z")

</div>

Thanks, learning so much from you today, I really appreciate it!

---

<div class="post-metadata">

**Author:** ![nader.chinichian](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nader.chinichian/32/9261_2.png) [@nader.chinichian](https://forum.inductiveautomation.com/u/nader.chinichian)\
**Post date:** [October 14, 2023, 7:02pm UTC](https://forum.inductiveautomation.com/t/scripting-function-to-read-the-project-description-property/16502/11 "2023-10-14T19:02:29Z")

</div>

How can I get this in Perspective for ignition 8.1?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [October 14, 2023, 7:12pm UTC](https://forum.inductiveautomation.com/t/scripting-function-to-read-the-project-description-property/16502/12 "2023-10-14T19:12:11Z")

</div>

Can you get it here?  
[https://docs.inductiveautomation.com/display/DOC81/system.perspective.getProjectInfo](https://docs.inductiveautomation.com/display/DOC81/system.perspective.getProjectInfo)
