[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Mac::Glue to CodeWarrior IDE?



At 19:31 -0600 2000.11.18, Alex Harper wrote:
>My understanding from the Glue docs is that event calls which generate a
>list of objects should result in a Perl list.

Yes.


>However @targslist above is a
>one element list.

Are you sure it is not supposed to be a one-element list?  Maybe that is
what CodeWarrior is supposed to return?  Try doing it in AppleScript.


>The element then returns nothing to the prop(name) call.

Well, there is something wrong with your code there.

	@targslist = $CW->obj(targets => gAll, of=> $doc);

What you really would want is:

	@targslist = $CW->obj(targets => gAll, $doc);

Or even:

	@targslist = $CW->obj(targets => $doc);

Because when you use the plural form ("targets"), Mac::Glue automatically
adds the gAll() for you if you didn't include it.  :)

I think the reason you may be confused is the example in the docs:

	$f->obj(files => of => 'System Folder');
	$f->obj(files => gAll, of => 'System Folder');
	$f->obj(file => gAll, of => 'System Folder');

The difference is that the "of" here is used as a synonym of "property".
That is, System Folder is a property of the Finder, and as such needs to be
marked as such.  We could do it with "in => 'System Folder'", "of =>
'System Folder'", or "property => 'System Folder'", depending on what seems
the most natural.

And you only need that when the property is not the first item in the list.
That is, you don't need it for "size => $obj", even though "size" may be a
property.  But you do need it for "size => of => 'Some Property'".

But in your example, $doc is not a property, it is an object.  The "of" is
superfluous.  Here, the vocabulary of AppleScript gets in the way: in cases
OTHER than for a property, an "of" in AppleScript is usually translated as
"," (or "=>").

So the "of" could be changing the entire semantics of your request; maybe
fixing this will you give you the expected result.


>Any suggestions appreciated. Examples that show how to parse CodeWarrior
>errors from Perl (my next project) would be even better.

What errors would those be?  Can you give an example?

-- 
Chris Nandor                      pudge@pobox.com    http://pudge.net/
Open Source Development Network    pudge@osdn.com     http://osdn.com/

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org