Help with ObjC appscript
Help with ObjC appscript
- Subject: Help with ObjC appscript
- From: Israel Chauca Fuentes <email@hidden>
- Date: Thu, 1 Oct 2009 05:26:36 -0500
Hi,
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];
==============
And it seems to work, as I get every email of every account like this
if I use:
NSLog(@"%@", result);
=============
2009-10-01 05:13:29.802 mailapp[72835:817] (
(
"email@hidden",
"email@hidden",
"email@hidden",
"email@hidden"l,
"email@hidden",
"email@hidden",
"email@hidden",
"email@hidden"
),
(
"email@hidden"
)
)
=============
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.
Cheers,
Israel
_______________________________________________
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