3

I am trying to save image from Adobe Photoshop as PNG, I have achieved this with the following code.

AdobePhotoshopApplication* psApp = [SBApplication applicationWithBundleIdentifier:@"com.adobe.Photoshop"];
AdobePhotoshopDocument *curDoc   = [psApp currentDocument];
AdobePhotoshopDocument *temp     = [curDoc saveIn:[NSURL URLWithString:[path stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] as:AdobePhotoshopSvFmPNG copying:YES appending:AdobePhotoshopE300LowercaseExtension withOptions:nil];

Well the only problem here is that even a simple image takes 4-5 MB. Now i want to provide AdobePhotoshopSaveOptions in saveIn:as:copying:appending:withOptions:

I can provide compression value in options, as it can be seen in

// Settings related to saving a PNG document
@interface AdobePhotoshopPNGSaveOptions : AdobePhotoshopSaveOptions    
@property NSInteger compression;  // compression used on the image. ( 0 - 9; default: 0 )
@property BOOL interlaced;  // should rows be interlaced? ( default: false )    
@end

Problem is, when i create options and pass it to saveIn method i get the following error

*** NSForwarding: warning: object 0x618000030280 of class '__NSMessageBuilder' does not implement doesNotRecognizeSelector: -- abort

I created the AdobePhotoshopPNGSaveOptions as

AdobePhotoshopPNGSaveOptions *options = [[psApp classForScriptingClass:@"PNG save options"] new];

I have no idea where to go from here.

Mirza Bilal
  • 891
  • 11
  • 34

0 Answers0