Skip navigation
Currently Being Moderated

Cannot return (keyboard) focus to Photoshop (requestStateChange doesn't work)

May 14, 2010 11:21 AM



When I’m using CSXSWindowedApplication on Windows  it seems the focus always belongs to Photoshop so it’s not a big  problem. While on Mac the focus belongs to the active panel and   CSXSInterface.getInstance().requestStateChange(StateChangeEvent.WINDO W_LOSE_FOCUS,   null) seems not working  at all.


Gabe Harbs recommended to use the app.activate method on  previous forums - like in InDesign, but there's no such method in  Photoshop's app class and also the problem is in de-activation.


How can I return back focus to Photoshop (to allow keyboard shortcuts etc.)?



Thank you!


P.S. I tried to use Application instead of CSXSWindowedApplication - the situation with it is the same. The focus is not being returned to Photoshop (on Mac).

  • Currently Being Moderated
    May 15, 2010 2:14 PM   in reply to Anastasiy Safari

    Hi Anastasiy,


    What I would try in ExtendScript would be to use Folder.appPackage to get a reference to the Photoshop app file, and use File.execute() to actiavte it. Pretty hacky, but it should work...


    I'm not sure what the equivalent would be using the Air File class, but if all else fails, you can always use:




    to use a custom ExtendScript function to do that...




    Mark as:
  • Currently Being Moderated
    May 15, 2010 10:31 PM   in reply to Anastasiy Safari

    Very odd. What exactly has focus?



    Mark as:
  • Currently Being Moderated
    May 16, 2010 2:36 PM   in reply to Anastasiy Safari

    Very weird...


    I'm more of an InDesign man myself.This is probably a Photoshop issue and I'm out of ideas. I guess we'll have to wait for someone who actually knows what he's talking about to come an fill us in...



    Mark as:
  • Currently Being Moderated
    Jun 23, 2011 8:32 PM   in reply to Anastasiy Safari

    I finally found a solution

    even not tricky yeah!



    Javascript code

    function activatePhotoshop() {



    Actionscript code


    btw, why I can't fild patchpanel library?


    just ignore cs2~4 users?


    doesn't make sense.

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points