Hi!
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).
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:
CSXSInterface.getInstance().evalScript("activatePhotoshop");
to use a custom ExtendScript function to do that...
HTH
Harbs
Thanks, man!
Well, scripting always involves some kind hacking ![]()
But it's a pity, your suggestion doesn't help
I'm writing the following in .jsx file:
function deact()
{
var f = new File("//Applications//Adobe Photoshop CS5//Adobe Photoshop CS5.app");
f.execute();
}
And in ActionScript:
CSXSInterface.instance.evalScript('deact');
I also tried doing app.ActiveDocument = app.ActiveDocument; in javascript.
Nothing works. It seems like flash/CS Extention panel loses focus, but it's not
being returned back to Photoshop (on Mac).
I'm doing the following test:
1) Open a test panel which has a "Lose focus" button, that does what you've suggested above
2) Create new document
3) Create a rectangular selection inside of it
4) Click on the panel to focus it
5) Click the button "Lose focus"
6) Click up, down, or Cmd+A, etc. combinations (to move current selection, or to call a Photoshop tool by a keyboard shortcut) - nothing happens except a Mac error sound.
I can clearly see that flash inside the panel lost its focus. I'm not sure if the panel itself, that contains all the
flash lost it. And I can't see what has focus now. When I click inside of the document, after all these voodoo things -
the shortcuts start to work.
Any ideas?
Thanks ![]()
P.S.
(I posted the previous test panel sources on prerelease forums. I can post it again.
It's actually a blank panel with the button that calls a script, nothing more)
I finally found a solution
even not tricky yeah!
| Javascript code |
|---|
function activatePhotoshop() { app.bringToFront(); } |
| Actionscript code |
|---|
| CSXSInterface.instance.evalScript("activatePhotoshop"); |
btw, why I can't fild patchpanel library?
just ignore cs2~4 users?
doesn't make sense.
North America
Europe, Middle East and Africa
Asia Pacific