# Determining if the Photoshop application is in focus from the UXP script

**URL:** <https://forums.creativeclouddeveloper.com/t/determining-if-the-photoshop-application-is-in-focus-from-the-uxp-script/5794>\
**Category:** UXP Plugin API\
**Tags:** javascript\
**Created:** [February 3, 2023, 1:54pm UTC](https://forums.creativeclouddeveloper.com/t/determining-if-the-photoshop-application-is-in-focus-from-the-uxp-script/5794 "2023-02-03T13:54:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rhinopitheque](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@Rhinopitheque](https://forums.creativeclouddeveloper.com/u/Rhinopitheque)\
**Post date:** [February 3, 2023, 1:55pm UTC](https://forums.creativeclouddeveloper.com/t/determining-if-the-photoshop-application-is-in-focus-from-the-uxp-script/5794/1 "2023-02-03T13:55:00Z")

</div>

Hello,

Is there a way to determine if Photoshop is the application that has focus (i.e. is in the foreground from the user’s perspective) from the UXP script ?  
I tried using require(“photoshop”).app.focus with no chance. I see that there exist a bringToFront method but no “focus” method.  
It would greatly help me!

Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Karmalakas](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/karmalakas/32/1048_2.png) [@Karmalakas](https://forums.creativeclouddeveloper.com/u/Karmalakas)\
**Post date:** [February 3, 2023, 2:11pm UTC](https://forums.creativeclouddeveloper.com/t/determining-if-the-photoshop-application-is-in-focus-from-the-uxp-script/5794/2 "2023-02-03T14:11:41Z")

</div>

Usually [forum search](http://forums.creativeclouddeveloper.com/search?q=app%20focus) is a good start to check if question was asked before and it seems [it was](http://forums.creativeclouddeveloper.com/t/blur-and-focus-events-for-uxp-host-application/5208), but looks like no way to determine yet. Unless it was silently added to the events

---

<div class="post-metadata">

**Author:** ![Rhinopitheque](https://avatars.discourse-cdn.com/v4/letter/r/9e8a1a/32.png) [@Rhinopitheque](https://forums.creativeclouddeveloper.com/u/Rhinopitheque)\
**Post date:** [February 3, 2023, 2:50pm UTC](https://forums.creativeclouddeveloper.com/t/determining-if-the-photoshop-application-is-in-focus-from-the-uxp-script/5794/3 "2023-02-03T14:50:59Z")

</div>

Thank you! Adding a notification listener on the hostFocusChanged event solved it.
