Am 19.02.2012 um 09:38 schrieb Beatrix Willius:

> I'm trying to change from AppleScriptMBS to NSAppleScriptMBS and have hit the 
> first problem: how do I get data out of the script?

Good question, you get a descriptor which contains a list of object descriptors 
which have properties to identify the mailboxes.

> How do I get the data out with the odd NSAppleEventDescriptorMBS? Data gives 
> me too much, StringValue doesn't do anything and I have no idea what 
> descriptorWithString(text as string) might do.

Well, I'll add new method description and print so you can learn what's inside 
easier.

> I just want to get my data out of AppleScript as string, string array and 
> date.

You can show list of mailboxes like this:

  
  dim source as string = "tell application 
""Mail"""+EndOfLine.Macintosh+"return mailboxes"+EndOfLine.Macintosh+"end tell"
  dim n as new NSAppleScriptMBS(source)
  dim d as Dictionary
  dim result as NSAppleEventDescriptorMBS = n.execute(d)
  
  if d<>nil then
    MsgBox d.Value(NSAppleScriptMBS.NSAppleScriptErrorMessage)
  else
    dim count as integer = result.numberOfItems
    dim names() as string
    
    for i as integer = 1 to count
      dim item as NSAppleEventDescriptorMBS = result.descriptorAtIndex(i)
      dim value as NSAppleEventDescriptorMBS = item.descriptorForKeyword("seld")
      
      list.addrow value.stringValue
    next
    
  end if
  

Greetings
Christian

-- 
Real Studio Conferences, Training and Meetings in Orlando, London, Pforzheim 
and Leipzig.

More details and registration here:
http://www.monkeybreadsoftware.de/realbasic/events/




_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to