• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Help with ObjC appscript
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with ObjC appscript


  • Subject: Re: Help with ObjC appscript
  • From: Philip Aker <email@hidden>
  • Date: Thu, 1 Oct 2009 04:22:13 -0700

On 2009-10-01, at 03:26:36, Israel Chauca Fuentes wrote:

I'm trying to get all email addresses from every account in Mail.app and print it as a list for a command line utility. This is the code I get using ASTranslate:

[...]

MLApplication *mail = [MLApplication applicationWithName: @"Mail"];
MLReference *ref = [[mail accounts] emailAddresses];
MLGetCommand *cmd = [[ref get] requestedType: [ASConstant unicodeText]];
id result = [cmd send];

[...]

Is there a way to "convert" the variable "result" into a NSString that would be easier to manage for me? Am I completely off the track and there is an easy way to print it to the terminal? I'm quite new to c and obj-c and I think this should be easy to accomplish, but I just can't see the way, so any help will be highly appreciated.

Looks like it's returning an AppleScript list of lists of text, so in Objective-C iterate through an NSArray of NSArrays of NSStrings. Note that you can always check the object class just to make sure.



Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Help with ObjC appscript
      • From: Israel Chauca Fuentes <email@hidden>
References: 
 >Help with ObjC appscript (From: Israel Chauca Fuentes <email@hidden>)

  • Prev by Date: Re: AS Application
  • Next by Date: Re: Help with ObjC appscript
  • Previous by thread: Help with ObjC appscript
  • Next by thread: Re: Help with ObjC appscript
  • Index(es):
    • Date
    • Thread