Run PS Constants Dilog from Photoshop

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: Tom, Kukurykus

catpishy

Run PS Constants Dilog from Photoshop

Post by catpishy »

Hello,

Is it possible to run the following file from with in Photoshop, it works OK in ESTK but fails in Photoshop.

file name: Final.jsx at:


http://www.4shared.com/file/sC9dqym_/final.html

Best

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

Mike Hale

Run PS Constants Dilog from Photoshop

Post by Mike Hale »

I don't know what the problem is but it doesn't run for me in Photoshop either. It throws an error before showing the dialog. But even in ESTK I get errors depending on options selected.
Mike Hale

Run PS Constants Dilog from Photoshop

Post by Mike Hale »

In the data section PSEnum you have just repeated the PSClass array so PSEnum is not populated.

In the PSClass array you have the last -P element as 0 and the first _R element as 1. I think that last -P element should be 27 and _R start with 0. I think PSClass_R having an undefined first element is one reason for the errors I get in ESTK. Also moving the data section above the dialog section seems to help speed things up.

I still don't understand why it will not show the dialog in Photoshop.

An 'all' button would be nice so one can list all class. enum, etc.
Paul MR

Run PS Constants Dilog from Photoshop

Post by Paul MR »

After putting try catch around I found that the Load_Listbox function couldn't see the UI componants, So I moved it before the show() and got this error:-
Error: Server interface error ''
- Server interface error 'Error from createWidget(42,-1,ListBox,ListBox,[object Object],79): ActionScript error: TypeError: Error #1034' - 47

From the documentation I can't see any documentation on the properties you have used for the listbox?
{ numberOfColumns: 2,showHeaders: true,columnTitles: ['Command', 'Code'], columnWidths: [200,200]});

It seems as ESTK can handle it but not Photoshop.
Mike Hale

Run PS Constants Dilog from Photoshop

Post by Mike Hale »

Paul MR wrote:From the documentation I can't see any documentation on the properties you have used for the listbox?
{ numberOfColumns: 2,showHeaders: true,columnTitles: ['Command', 'Code'], columnWidths: [200,200]});

It seems as ESTK can handle it but not Photoshop.

Those creation properties are listed on page 122 of the CS4 tools guide. There is also an example of creating a multi-column listbox on page 71 that also doesn't work in Photoshop.

I think the multi-column listbox is broken in Photoshop. Using the code below I can get a multi-column listbox to show in Photoshop but when I cancel by using either the cancel button or closing the dialog window Photoshop crashes but it returns 2 as it should in ESTK.
Code: Select allvar dlg = new Window("dialog");
dlg.list= dlg.add ('ListBox', undefined, 'asd',{numberOfColumns: 2})//, showHeaders: true,columnTitles: ['First Name', 'Last Name']});

var item1 = dlg.list.add ('item', 'John');
// add the label value for the second column in that row.
item1.subItems[0].text = 'Doe';
dlg.btnClose = dlg.add( 'button', undefined, 'Cancel', { name:'cancel' });

dlg.show();
Paul MR

Run PS Constants Dilog from Photoshop

Post by Paul MR »

Thanks for that Mike, I also found that the eval in Photoshop needs to have the var declared before the eval, that's why there was no data, it was returning undefined. At least it works, well sort of the function and listbox now wants refining again.
Mike Hale

Run PS Constants Dilog from Photoshop

Post by Mike Hale »

Sorry to bump an old thread but does anyone with CS6 know if multi-column listbox has been fixed for Photoshop?
TMorris

Run PS Constants Dilog from Photoshop

Post by TMorris »

Mike,

Yes, listboxes appear to work correctly now in CS6.
Mike Hale

Run PS Constants Dilog from Photoshop

Post by Mike Hale »

Thanks for the reply. I had to find a work around for CS5 but I am glad to know that I may not have to in the future.