# Sending Messages Between Pages in Perspective

**URL:** <https://forum.inductiveautomation.com/t/sending-messages-between-pages-in-perspective/41540>\
**Category:** Ignition\
**Tags:** scripting, perspective\
**Created:** [December 15, 2020, 8:03pm UTC](https://forum.inductiveautomation.com/t/sending-messages-between-pages-in-perspective/41540 "2020-12-15T20:03:06Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![tupanaster](https://avatars.discourse-cdn.com/v4/letter/t/5daacb/32.png) [@tupanaster](https://forum.inductiveautomation.com/u/tupanaster)\
**Post date:** [October 3, 2022, 3:19pm UTC](https://forum.inductiveautomation.com/t/sending-messages-between-pages-in-perspective/41540/15 "2022-10-03T15:19:41Z")

</div>

> [@cmallonee](#):
>
> Hint: it’s not.  
> If you call someone and they haven’t been born yet, then they won’t receive your call.

I was trying to do the same. So, now I'm looking for a way to get the pageID of the unborn page.

I think that I can locate the new page by using this code:

> [@Is the pageID unique?](https://forum.inductiveautomation.com/t/is-the-pageid-unique/50722/6):
>
> It's true that the Popup has no way to directly refer to the "parent" page it belongs to. You should only need to specify a pageId argument if you intent to target a different page. For example, consider a session which has two pages open. You place a button which is supposed to close the other page. You would use something like this: session\_objs = system.perspective.getSessionInfo() for session\_obj in session\_objs: if session\_obj.id == self.session.props.id: for page\_id in session…

Then `if page_id == self.page.props.pageId:` should do the trick. But, If that's true, why not use `self.page.props.pageId` directly?

Edit #1:  
I tested using a delay but now I know that it's using the old pageID.

```auto
from threading import Timer
	
	page = "/newtestpage"
	system.perspective.navigate(page)
	
	
	def runThisLater(param):
		payload = {"test": True}
		scope = "page"
		message = "newStatus"
		system.perspective.sendMessage(message, payload , scope)
	 
	# Call invokeLater with a 3000ms delay. Note that our function will not run immediately
	# because invokeLater always executes once the rest of this script is complete.
	Timer(1.0, runThisLater, ["Stop Waiting, I'm done"]).start()

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/sending-messages-between-pages-in-perspective/41540)._
