Impossible lost keyboard focus bug

Discussion of Photoshop Scripting, Photoshop Actions and Photoshop Automation in General

Moderators: Tom, Kukurykus

reimund

Impossible lost keyboard focus bug

Post by reimund »

Ok, maybe not impossible. At least I hope not!!

Some background: I making a plugin that consists of some photoshop scripts and a panel created in Adobe Configurator. Basically the panel has some buttons which executes some functions in the script. The plugin is described in greater detail and can be downloaded here http://lumens.se/tychpanel

The Problem: I'm not sure exactly when or why, the panel, which is actually Flash, steals the keyboard focus so that you cannot for instance enter a filename when you save the file. It can happen after just stacking some images using the 'Stack it up' button. But other times stacking works fine.

I'm on Mac OSX and I don't know if this happens on Windows as well. You can, temporarily, regain keyboard focus by clicking on the panel anywhere where there's not a button.

I thought I had it solved with the workaround suggested over here http://forums.adobe.com/thread/638863?tstart=0
That is, by calling Folder.appPackage.execute() when the script has finished working. However, further testing shows that the bug still arises.

Help is greatly appreciated!

Cheers
Reimund

Professional AI Audio Generation within Adobe Premiere Pro - Download Free Plugin here

larsen67

Impossible lost keyboard focus bug

Post by larsen67 »

I would doubt very much this is your solution… But Harbs suggested app.activate() an ID method… The PS equivalent would be app.bringToFront()
reimund

Impossible lost keyboard focus bug

Post by reimund »

Thanks for the suggestion larsen, couldn't get that working either though.

But I think I nailed it down as to how to reproduce it:

Give the panel focus by clicking somewhere on it.Switch to another application, then back to Photoshop. Keyboard focus is lost.
This is on Mac OSX. I will do some further tests to see if it happens on Windows as well. In the meantime, can anyone explain whats going on?
reimund

Impossible lost keyboard focus bug

Post by reimund »

I have now confirmed that this does not occur on Windows 7.