Re: [F-Script-talk] Bug? Multi-messaging gives different result
Brought to you by:
pmougin
From: Philippe M. <pm...@ac...> - 2008-07-13 16:33:32
|
Le 13 juil. 08 à 16:55, Tommy Sundström a écrit : > I've encountered an problem when using Scripting Bridge to control > MindManager. (F-script 2.0 alpha 4) First some setup code: > > mindManager := SBApplication applicationWithBundleIdentifier: > 'com.mindjet.mindmanager.7' > d := mindManager documents objectWithName: 'Applescript, Python och > andra sätt att styra macen' > > Then if I do like this: > > > (d topics) task > > I get a list of SBObjects, like this one: <SBObject @0xbe16a0: task > of MindManagerTopic id "3CABF503-13D3-487B-BA14-7E000E6AA2B7" of > MindManagerDocument "Mindmap" of application "MindManager" (1263)> > > But, if I do like this: > > > (d topics at:1) task > > I get a MindManagerTask object, like this one: <MindManagerTask > @0xbd2120: task of MindManagerTopic 1 of MindManagerDocument > "Mindmap" of application "MindManager" (1263)> > > I'm a F-script newbee, but am I correct in assuming that these two > operations are supposed to result in the same type of objects? In most situations, this is correct. When using the Scripting Bridge, however, what these two operations are supposed to result in are "equivalent objects" (i.e., objects that will exhibit the same behavior, at the application semantic level, when used further). What you see here is probably the result of behind-the-scene optimizations taking place here to lighten the cost of inter application communication (e.g., when possible, loops are offloaded to the remote application, instead of being performed locally by F-Script). If the results are not "equivalent", then this is a bug either in F- Script, Apple's Scripting Bridge or the remote application itself. Note that using the Scripting Bridge (be it from Objective-C, F-Script or other languages) still appears to raise a number of issues and challenges. You can usually work around these issues by trials and errors. Philippe |