Good example of script interface and usability

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

Moderators: Tom, Kukurykus

undavide

Good example of script interface and usability

Post by undavide »

Hello,
I've happened to run into some really well done PS scripts from an Israelian company called pskiss.com (I'd like to specify that I am not related to them in any way). I've bought three of them, both for "personal use" and to study how they're made - interesting things I've learned.

1. I didn't know that a script could belong to the Filter menu. You have to put the jsx in the presets/scripts folder, and add these lines at its beginning:

Code: Select all<javascriptresource>
<name>Filter name</name>
<category>Not sure what is this</category>
<menu>filter</menu>
<about>Your about info</about>
<enableinfo>true</enableinfo>
</javascriptresource>
I would have bet that the category was the "folder" (like "Blur" contains all the blurring filters) but it's not. Anyway, nice feature that I didn't know.

2. As usual, the jsx contains binary code. Speaking of the "Clarté" one, it launches a small javascript UI, with nothing more than a slider and a "Preview" checkbox. Strangely enough, and this is something that personally I have never been able to replicate, enabling the preview makes "something" happen in the background: without any filter progress bar, any visible layers palette change... it seems that the PS ui freezes for a couple of seconds, then the opened files shows the script/filter effect. Pressing the "done" button, applies the effect to a duplicate layer and closes the UI.
What I've found interesting (besides the algorithm) is just this complete absence of movement: no distractions, nothing - and the script algorithm is well protected
How is it possible? I mean, if I need to run a filter, like a GBlur, I can't hide its progress bar, can I?

UPDATE
-------------
I was running the script to my usual lowres test image - if you pick a larger files, progress bars show.
-------------

3. It's interesting the integration they make between flash extensions and PixelBender (PB) kernels.
They sell few packages which are basically a PB graphs (so a concatenation of kernels) that you call from a standard extension (made with Configurator2, I guess). The extension opens the PBGallery which then runs the appropriate Graph, showing sliders and everything. It's a well done integration, whose only flaw is that the PB code is not binary (so it can be read) and you bounce from the extension to the PBGallery.
This is possibly the response to a question that I've asked in several forums without any explicit answer: I've always wondered whether one can embed a PB binary kernel and use it as a flash filter (which will be applied to the current document, without PBGallery calls) inside a CS SDK made PS extension. I'm tempted to infer from the fact they didn't, that it's not possible. Has anyone ever tried it?

That said, they did a good job. Seeing the struggle that a friend of mine is experiencing with XCode and PS filters (less documented subject in the image processing field, he said), I suspect that extensions and CS SDK will progress a lot in the future.
Regards,

Davide
ddbell

Good example of script interface and usability

Post by ddbell »

Thanks for posting this! I've wanted to put stuff into the filter menu for awhile. Users seem much more comfortable with the filter menu than the scripts menu.

I got this to work in CS4 and CS5. CS3 puts a launch for the script inside the filter menu OK. However, it gives an error when it launches. The error says variable or value expected Line: 1 <javascriptresource>

I wonder if its possible to create a sub menu category similar to how plug-ins would to group scripts together.
undavide

Good example of script interface and usability

Post by undavide »

Users seem much more comfortable with the filter menu than the scripts menu.
Maybe it just looks more "professional"?
Me too, I'd like to find a way to group items in submenus: the <category> tag doesn't work for that - I don't even know where to find documentation about it.
Cheers,

Davide
Paul MR

Good example of script interface and usability

Post by Paul MR »

You will find information :-
Page 204 in Photoshop CS3 JavaScript Ref.pdf
Page 190 in Photoshop CS4 JavaScript Ref.pdf
Page 191 in Photoshop CS5 JavaScript Ref.pdf
undavide

Good example of script interface and usability

Post by undavide »

Thanks Paul!

According to the Reference, the <category> tag will group commands in the same menu *if* there are at least two items sharing the same category.
Regards,

Davide
ddbell

Good example of script interface and usability

Post by ddbell »

undavide wrote:Thanks Paul!

According to the Reference, the <category> tag will group commands in the same menu *if* there are at least two items sharing the same category.
Regards,

Davide

I created 2 different scripts with the same category. It isn't working for me.
undavide

Good example of script interface and usability

Post by undavide »

ddbell wrote:undavide wrote:Thanks Paul!

According to the Reference, the <category> tag will group commands in the same menu *if* there are at least two items sharing the same category.
Regards,

Davide

I created 2 different scripts with the same category. It isn't working for me.

I've been told in the Adobe's forum that <category> is simply supposed to group the two items (that is: keeping them close in the menu), not to create a sub-menu. For which there is no solution, as far as I know at least.

Davide
Scott Miles

Good example of script interface and usability

Post by Scott Miles »

The javaScript resource tags seem to be working for the most part but I do have some scripts that don't appear in the Filters Menu that also have tags. I've even gone to the extent of adding event id tags but that doesn't seem to resolve the issue either:

Code: Select all/*
<javascriptresource>
<name>Center Guides</name>
<category>SSPS_SpecOne</category>
<menu>filter</menu>
<about>Creates Center Guidelines</about>
<enableinfo>true</enableinfo>
<eventid>cd2ca3f1-9b62-11e0-aa82-0800200c9a66</eventid>
</javascriptresource>
*/

As per the Javascript Reference Manual, the tags are contained within comments and are also within the first 10,240 characters of the file.

Any help would be appreciated... TIA

I found the issue, I didn't realize that scripts that contained javascript resource tags like the one above will show up in the Photoshop Filters Menu regardless of whether they're stored in the Filters directory or the scripts directory. Consequently, I had a conflict between several scripts that were duplicates.
lukasz

Good example of script interface and usability

Post by lukasz »

any idea if this works in Illustrator too? this is very interesting.
Dariusz1989

Good example of script interface and usability

Post by Dariusz1989 »

Heya

I've been using the approach listed on the top quite sucessfulyl so far. However I was wondering how can I make my own category ? So I have Category + subcategory with list of my scripts? Atm all drops at the bottom...

Thanks, bye.