Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Is it possible to add datarows from cocoa to an Applescript DataSource?



I am trying to use spotlight from Applescript. To achieve this I have created a cocoa method in a category of NSApplication which perform the actual spotlight search via the cocoa API.

I script the user interface via Applescript Studio and use a table view to display the result from the spotlight search. To avoid allocating and copy unnecessary in Applescript I had hoped that it was possible to add data rows directly from cocoa to the Applescript data source. That way, the call from AppleScript would be very simple, like so (instead of copying data from a returned array);

set update views of theDataSource to false
call method "doSpotligthSearch:toDataSource:" with parameters {aQuery, theDataSource}
set update views of theDataSource to true


However this seems harder than I thought, the Applescript data source is an instance of ASKDataSource and I cannot find any documentation for this class anywhere. Why in .. does apple not expose this API? Does anyone know if it is possible to update an AppleScript data source at all from cocoa? Either by using some non-documented methods of ASKDataSource or using other hacks?

I just started a couple of days ago with Applescript and cocoa and haven't had time to look at everything yet. Maybe there are some reflection like API in cocoa/ObjC that could be used to inspect ASKDataSource?

Appreciate any help on this.


with regards



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.