I am trying to use Scripting Bridge to do some minor control of Adobe Photoshop CS3 from my Cocoa app. I have followed the instructions in the "Scripting Bridge Programming Guide for Cocoa", specifically:

1. Generate header files for all scriptable applications that your code is sending messages to: I used "sdef /Users/Shared/Adobe\ Photoshop\ CS3/Adobe\ Photoshop\ CS3.app | sdp -fh --basename AdobePhotoshopCS3" to generate this header.
2. Add these files to your project. (done)
3. In your header or implementation files, add #import statements for the generated header files. (done)
4. Add the Scripting Bridge framework to your project. (done)

Here is the modest amount of code I'm using right now:

AdobePhotoshopCS3Application *psApp = [SBApplication applicationWithBundleIdentifier:@"com.adobe.Photoshop"];
if ([psApp isRunning]) {
   SBElementArray *docs = [psApp documents];
   NSUInteger index ;
   AdobePhotoshopCS3Document *doc;
AdobePhotoshopCS3JPEGSaveOptions *options = [AdobePhotoshopCS3JPEGSaveOptions new];
   options.quality = 12;
   for (index = 0; index < [docs count]; index++) {
      doc = [[docs objectAtIndex:index] get];
      [doc saveIn:doc.filePath
               as:AdobePhotoshopCS3SvFmJPEG
          copying:NO
        appending:AdobePhotoshopCS3E300NoExtension
      withOptions:options];
   }
   [options release];
}

It compiles fine, but I get this link error:
Undefined symbols:
  ".objc_class_name_AdobePhotoshopCS3JPEGSaveOptions", referenced from:
literal- poin...@__objc@__cls_r...@adobephotoshopcs3jpegsaveoptions in AMBatchEditMonitor.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

It's in the header file that got generated

@interface AdobePhotoshopCS3JPEGSaveOptions : AdobePhotoshopCS3SaveOptions
@property BOOL embedColorProfile;  // embed color profile in document
@property AdobePhotoshopCS3E270 formatOptions;  // ( default: standard )
@property AdobePhotoshopCS3E880 matte;
@property NSInteger quality; // quality of produced image ( 0 - 12; default: 3 ) @property NSInteger scans; // number of scans. Only valid for progressive type JPEG files ( 3 - 5 )
@end

but where's the object code for it? The other classes used (AdobePhotoshopCS3Application and AdobePhotoshopCS3Document) are apparently linked OK, so what gives with the JPEGSaveOptions?


Thanks!
randy

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to