I'm trying to crop the image in the same way you would in photoshop.
You select the area with the marquee then select the crop tool, this then has the tick box to crop without deleting the pixels.
How can I do this please?
I believe the crop that I use below is from the menu item and not the crop tool.
tellapplicationid "com.adobe.photoshop"
setruler unitsofsettingstopixel units
tellcurrent document
trimbasing trim ontop left pixel
set {height:originalHeight, width:originalWidth} toit
logoriginalWidth
log
selectregion {{0, (originalHeight / 2)}, {originalWidth, (originalHeight / 2)}, {originalWidth, originalHeight}, {0, originalHeight}} withoutantialiasing
settheCropBoundstoboundsofselection
--crop based on selection without deleting pixels as per crop tool not crop in the menu item
cropboundstheCropBounds
--reveal all
endtell
endtell