Dialog focus issues - Vista / Photoshop CS4

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

Moderators: Tom, Kukurykus

TMorris

Dialog focus issues - Vista / Photoshop CS4

Post by TMorris »

I was wondering if someone could confirm the following issue for me.

Someone using a script that I developed told me that they were experiencing focus issues when running the script in Photoshop CS4 on Windows Vista. I don't have access to Vista, and I'm unable to reproduce the issue using Windows 7 (in either CS or CS5).

Steps to reproduce (according to the user):

1. Launch Photoshop
2. Open another application and bring it to the foreground
3. Run the simple script below (in Photoshop)

After script execution the other application (from Step 2) comes to the foreground -- regardless if you click OK, Close, or the "x" button.

Can anyone confirm this? Does anyone see anything wrong with the script? Thanks very much for your assistance!

Code: Select all#target photoshop
app.bringToFront();

var dlg = getDialog();
dlg.show();

function getDialog() {
  var dlg = new Window('dialog');
  var okButton = dlg.add('button');
  okButton.text = 'OK';
  var cancelButton = dlg.add('button');
  cancelButton.text = 'Cancel';
  return dlg;
}