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

Re: [MacPerl-Modules] Glue: working with reference forms



>Oh, I see what happened.  I should have asked you what "print $selection"
>said.  It has been a long day for me.  :)
>
>What happens is that AppleScript objects are returned as AEObjDesc Perl
>objects.  The actual object is in $selection->{DESC}.  You can do, for
>instance:
>
>  print AEPrint $selection->{DESC};
>
>But the best thing to do is see if there is a data type you can request the
>data as, such as:
>
>  get foo as bar
>
>I would try:
>
>  as => 'number'
>
>or something.  Check the enumerations section of the app's dictionary.
>Or, do:
>
>  $foo = $selection->{DESC}->get


Okay, let's go back to what AppleScript gives me (which should be something
I can access with ->{DESC}->get.  AppleScript gives me a reference form,
like :

record id -1.062730013E+9 of window "Computers" of application "netOctopus"

or, in the case of a selection of multiple items:

{records from record id -1.062730087E+9 to record id 1.068117901E+9 of
window "Computers" of application "netOctopus"}

or when there is a disjoint selection: {record id 188149 of window
"Computers" of application "netOctopus", record id -1.062730223E+9 of
window "Computers" of application "netOctopus", record id 145567 of window
"Computers" of application "netOctopus", records from record id
1.068117901E+9 to record id 189211 of window "Computers" of application
"netOctopus", records from record id 154996 to record id 189588 of window
"Computers" of application "netOctopus"}

Again, in AppleScript, I can do
tell application "netOctopus"
	set myList to selection of Computers window
	repeat with thisItem in myList
		set thisOwner to cell "Owner" of thisItem
		set OwnerList to OwnerList & thisOwner
	end repeat
end tell

and get a list containing the owner names of the current selection.

This is what I want to do in perl. Now, I could do something a little
different, I could access the pieces of the selection individually - get
first record of selection - but I'd rather slurp the selection into a
variable, and work with it  from there, as I do in the AppleScript.

-Jeff Lowrey



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