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

[MacPerl] Glue



I started working with Glue again recently (great work Chris!) and want to
share some observations in hope of possibly influencing the next version.

1) I'm working with apps that use a plugin architecture. In these apps some
aete information is found in the plugins. If I drag the main app onto the
glue droplet it extracts a file full of garbage. But if I use an individual
plugin with an aete it seems to work ok. This happens to me with CodeWarrior
for example.

2) I'm working with a dictionary that makes extensive use of properties. I
can do things in AppleScript that I can't do in perl/Glue. To explain I need
to give you a snippet from the Object Model:

### begin object model ###
Application
	property: Active Window (tag = 'pacw') # this refers to a window (cwin)
object
	element: document

Document:
	element: Window

Window: (tag = 'cwin')
	property: Active Spread (tag = 'pacs') # this refers to a spread (sprd)
object
	element: Spread

Spread: (tag = 'sprd')
	property: name
### end object model

In applescript I can say:
	set result to name of ActiveSpread of ActiveWindow

But I can't seem to do this naturally in Glue. What I would like to say is
something like this:

$result = $k2->get(
	$k2->p('name', property=>'active_spread', property=>'active_window')
)->get();


I believe that this can't work because of Glue::_doObj tries to check that
active_spread is a valid property of the active window at "compile time",
i.e. before the getdata event has been sent. But since the tag for Active
Window is not 'cwin' _doobj() thinks that there's a problem. I would like to
suggest that you drop the "compile time" property validation. Instead you
could build a big flat hash of all the properties upon Glue instantation. It
might appear that this would risk some name clashes. But I believe that this
is how AppleScript does it. I seem to recall from implementing AE Object
Models in the past that AppleScript puts all tags and strings in one big
global namespace. That is, it gets pretty unhappy if there is not a one to
one mapping between tags and associated strings. Thoughts?

Thanks,
-Mat Marcus







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