Re: Scripting Bridge link error
Re: Scripting Bridge link error
- Subject: Re: Scripting Bridge link error
- From: Randall Meadows <email@hidden>
- Date: Thu, 10 Sep 2009 13:39:04 -0600
On Sep 9, 2009, at 8:12 PM, Jason Foreman wrote:
You don't actually instantiate ScriptingBridge objects directly
like that. The interface header is generated so you can get type
checking when you call methods, but the actual class is acquired
dynamically at runtime. See the documentation for -
classForScriptingClass: in SBApplication. You'll need to do
something more like:
AdobePhotoshopCS3JPEGSaveOptions *options = [[psApp
classForScriptingClass:@"AdobePhotoshopCS3JPEGSaveOptions"] new];
OK, now that I've successfully created this "options" object...what
the heck do I do with it?! I create the object in the first place in
order to pass it as the past argument to a document's -
saveIn:as:copying:appending:withOptions: method. It doesn't really
belong to a container object (AFAICT), so when the doc says
"Immediately after creating the object, insert it in the appropriate
element array. The object is not “viable” in the application until it
has been added to its container. Consequently, you cannot set or
access its properties until it’s been added.", I'm at a loss figuring
out which "container" it is supposed to be added to before I can even
do "options.quality=12;" in order to pass it to that method.
I'd love to be able to query the document to get this (so that I can
do this only if the quality is not already 12), but I've found no way
via AppleScript to find this out. Currently, I'm using "do shell
script" to run the command line tool 'exiftool' to query the image
file for the "PhotoshopQuality" EXIF value, but I'd like to avoid this
if possible.
Any tips would be greatly appreciated! Thanks!
randy_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden