hi hans,
hab gestern mal a bisl im netz recherchiert.
leider bekommt man nicht die bounds einer seletion in ps. der bounds eintrag ist zwar vorhanden wird aber (noch) nicht unterstützt.
daher ein kleiner workaround (abkürzungen lk=linke kante, ok=obere kante usw.):
1. auswahl eines freistellers laden
2. neue ebene erstellen und in dieser die auswahl mit z.B. weiß füllen
3. die bounds von dem neuen layer holen (lk, ok, rk, uk) (da hätten wir nun die bounds, werden in punkt angegeben)
4. select region {{lk,ok},{rk,ok},{rk,uk},{lk,uk}} (der erste punkt ist oben links, dann gehts im uhrzeigersinn weiter. hier die punkt angaben in pixel umrechnen, {x,y})
tell application "Adobe Photoshop CS2"
activate
tell front document
set tmpFactor to resolution / 72
set tmpHistory to current history state
create selection of path item 1
set current layer to make new art layer at beginning with properties {name:"tmpBounds"}
fill selection with contents {class:RGB color, red:255, green:255, blue:255}
set thebounds to bounds of layer "tmpBounds"
set current history state to tmpHistory
set tmpItemOne to ((item 1 of thebounds) * tmpFactor)
set tmpItemTwo to ((item 2 of thebounds) * tmpFactor)
set tmpItemThree to ((item 3 of thebounds) * tmpFactor)
set tmpItemFour to ((item 4 of thebounds) * tmpFactor)
select region {{tmpItemOne, tmpItemTwo}, {tmpItemThree, tmpItemTwo}, {tmpItemThree, tmpItemFour}, {tmpItemOne, tmpItemFour}}
end tell
end tell
gruß
TMA
als Antwort auf: [#421401]