Feature wishlist

Upload Photoshop Scripts, download Photoshop Scripts, Discussion and Support of Photoshop Scripts

Moderators: Tom, Kukurykus

pfaffenbichler

Feature wishlist

Post by pfaffenbichler »

What exactly would the »fast layer property« be?

maybe name the new property selectedLayers and have it return an array of layers. If only one layer is selected it returns an array of one element. And have it return an empty array if no layers are selected.

Definitely good ideas.

May I ask if someone of the responsible Adobe-personnel is likely to peruse this thread or might posting in the Photoshop Feature Request Forum be more likely to garner attention?
xbytor

Feature wishlist

Post by xbytor »

PS Collections are just like Arrays. You can index them via name (usually) and index (always).

ID Collections are significantly different. They are more like query results. Kind of like those folders in Win or OSX that show the result of a search. While you can logically operate them as you would an Array, they also come with a bunch of nifty methods because of the highly nested structure of the underlying data. Plus, you can do stuff like 'doc.artLayers.fillOpacity = 20;' which (if it worked in PS) would set the opacity of all top level layers in one shot. Very powerful stuff. Of course some of these things can be done via the ActionManager API (e.g. operations on all currently selected layers) it just nowhere near as concise.

The differences exist primarily because PS deals with pixels and ID deals with text. This explains why working with text in PS is painful and slow. For it to be easy and efficient it would require something similar to ID's implementation and DOM.

And because of the way Photoshop handles layers in the DOM I'm not sure how everyItem(), firstItem(), lastItem(), middleItem(), nextItem(), or previousItem() would work with layers. Should it work with the whole layer stack or just the current layerset?

You would provide additional properties: doc.allLayers would give you the complete set of layers in the doc, doc.selectedLayers would give you the currently selected layers, and doc.visibleLayers would give you all visible layers. If they added this kind of support, I could throw out 10% of stdlib.js and probably increase performance in some of my scripts by 20% :)

I hope this makes some sense. I'm still half asleep...
larsen67

Feature wishlist

Post by larsen67 »

Mike, I too started scripting with Photoshop. InDesign has a very big and complex DOM that can be quite a struggle to get used to. Both Photoshop & Illustrator share getByName() which is classed as a method in InDesign its item() and classed as a property… Never quite understood that one… but never mind that. I know that Photoshop has no where near the amount of object collections of InDesign. And Im sure all this can be done in Photoshop already using Action Manager code but I was thinking is why isn't there a more consistent approach across the suites app's using the DOM… The areas that I would guess this 'may' work for are artlayers, layer sets, path items, channels…

Kind of like this code:

Code: Select allapp.activeDocument.artLayers.getByRange(2,5).resize(80,80,AnchorPosition.MIDDLECENTER);

Code: Select allapp.activeDocument.layerSets.firstItem().artLayers.everyItem().translate(100,200);

I would agree with the selectedLayers and an array that would make good sense…

edit… Sorry X was half way through typing when you must have posted…

I do like this though it can be very nice to use (and makes a little more sense to me) And I thought collections were just some non real Array… ooooops!
Mike Hale

Feature wishlist

Post by Mike Hale »

pfaffenbichler wrote:What exactly would the »fast layer property« be? Something faster than looping through the layers collection to get the index.
May I ask if someone of the responsible Adobe-personnel is likely to peruse this thread or might posting in the Photoshop Feature Request Forum be more likely to garner attention?I'm not sure if anyone from Adobe will visit this forum. Tom Ruark suggested that we start a bug/feature topic here.
When the CS6 prerelease starts, I was going to collate the bugs and feature requests here and summit them. Any discussions here ( I would hope ) will add weight to those submissions. I also plan to CC Tom.
Mike Hale

Feature wishlist

Post by Mike Hale »

One advantage of posting here instead of the official bug/request forum is that we can see what others have posted. Disagree, agree, or expand the suggestion. Any bug or feature requests made here will end up added to the official list at some point, but perhaps this way they will be better thought out, have better supporting arguments, etc.
pfaffenbichler

Feature wishlist

Post by pfaffenbichler »

When the CS6 prerelease starts, I was going to collate the bugs and feature requests here and summit them.
Glad to read that you are taking that upon you.

Something faster than looping through the layers collection to get the index.
Right, that’s another good point.