Objective c Photoshop的OSX脚本桥选项
我正试图将Adobe Photoshop中的图像保存为PNG,我用以下代码实现了这一点Objective c Photoshop的OSX脚本桥选项,objective-c,macos,cocoa,photoshop,scripting-bridge,Objective C,Macos,Cocoa,Photoshop,Scripting Bridge,我正试图将Adobe Photoshop中的图像保存为PNG,我用以下代码实现了这一点 AdobePhotoshopApplication* psApp = [SBApplication applicationWithBundleIdentifier:@"com.adobe.Photoshop"]; AdobePhotoshopDocument *curDoc = [psApp currentDocument]; AdobePhotoshopDocument *temp = [cur
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];
这里唯一的问题是,即使是一个简单的图像也需要4-5MB。现在我想在saveIn:as:copying:appending:withOptions:
我可以在选项中提供压缩值,如中所示
// 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
问题是,当我创建选项并将其传递给saveIn
方法时,我得到以下错误
*** NSForwarding: warning: object 0x618000030280 of class '__NSMessageBuilder' does not implement doesNotRecognizeSelector: -- abort
我创建了AdobePhotoshopPNGSaveOptions
AdobePhotoshopPNGSaveOptions *options = [[psApp classForScriptingClass:@"PNG save options"] new];
我不知道从这里到哪里去