applescript adobe illustrator export photoshop art-board problem

trying to export as photoshop document cropped to the mask or art-board area.
but I cannot get this script to export, what on earth could be the problem?

any ideas people

AppleScript: 2.2.1 (100.1)
Browser: Safari 535.19
Operating System: Mac OS X (10.5)

G’day Handell

“artboard clipping” appears to be only for GIF’s, JPEG’s, PNG8 & PNG24 files, it doesn’t show up in the allowed export options for Photoshop, so this needs to be eliminated.

Try the below which does what your wanting less the above

tell application "Adobe Illustrator"
	tell document 1
		set bndz to visible bounds of path item 1 of group item 1 of layer 1
		set artboard rectangle of artboard 1 to bndz
		set dpi to 150 as text
		set newFilePath to (path to desktop folder) & "my_masked_image.psd" as string
		tell application "Adobe Illustrator"
			export current document to file newFilePath as Photoshop ¬
				with options {class:Photoshop export options ¬
				, color space:RGB ¬
				, embed ICC profile:true ¬
				, resolution:dpi, warnings:false ¬
				, artboard range:1 - 1}
		end tell
	end tell
end tell

Ah! I see Budgie, I should have checked the manual on that. Thanks
However the problem I have is the mask area is generally smaller than the image & I need the art-board clipping option in order to crop the image and bring it back in AI to make for smaller file sizes.


Im surprised illustrator doesn’t have a feature to physically crop images within