Christian
I tried your suggestions - but no luck. By using
s1=a.searchElementForPersonProperty … instead of g.searchElementForProperty -
it its now searching the entire AddressBook rather than just the desired Group.
So I also tried:
//create the seach elements for last, first and middlenames
for i as integer = 0 to names.ubound
s1=a.searchElementForPersonProperty(a.kABLastNameProperty,"","",names(i),a.kABContainsSubStringCaseInsensitive)
s2=a.searchElementForPersonProperty(a.kABFirstNameProperty,"","",names(i),a.kABContainsSubStringCaseInsensitive)
s3=a.searchElementForPersonProperty(a.kABMiddleNameProperty,"","",names(i),a.kABContainsSubStringCaseInsensitive)
dim children() as ABSearchElementMBS = array(s1, s2, s3)
//combine those element for this name
sE(i) = a.searchElementForConjunction(cOR, children)
next i
sE(names.ubound+1) =
a.searchElementForGroupProperty(a.kABGroupNameProperty, "", "", hGroup,
a.kABEqualCaseInsensitive)
end
//now combine all the search elements for all names
s = a.searchElementForConjunction(cAND, sE)
if s<>nil then
show_wDropDown(x,y, a.recordsMatchingSearchElement(s) )
end
But still no luck. Nil return.
My only recourse now is to get the g.members from the group and do a manual
search loop within RealBasic against the properties of each of the members.
Is this a bug - should it be reported somewhere?
Jim
>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 15 May 2012 14:39:59 -0500
> From: Jim Pitchford <[email protected]>
> Subject: [MBS] Filter addressBook names within a Group
> To: [email protected]
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=us-ascii
>
> I am trying to show a list of names from an addressbook group in a drop down
> menu. I want to be able to show those people that match those in the names()
> array.
>
> The code snippet I have is as follows:
>
> dim g as ABGroupMBS
> if hGroup <> "" then
> g = Get_ABGroup(hGroup) //separate function that returns the group
> based on the name "hGroup"
> end
>
> //create the seach elements for last, first and middlenames
> for i as integer = 0 to names.ubound
>
> s1=g.searchElementForProperty(a.kABLastNameProperty,"","",names(i),a.kABContainsSubStringCaseInsensitive)
>
> s2=g.searchElementForProperty(a.kABFirstNameProperty,"","",names(i),a.kABContainsSubStringCaseInsensitive)
>
> s3=g.searchElementForProperty(a.kABMiddleNameProperty,"","",names(i),a.kABContainsSubStringCaseInsensitive)
>
> dim children() as ABSearchElementMBS = array(s1, s2, s3)
>
> //combine those element for this name
> sE(i) = a.searchElementForConjunction(cOR, children)
>
> next i
>
> //now combine all the search elements for all names
>
> s = a.searchElementForConjunction(cAND, sE)
>
> show_wDropDown(x,y, a.recordsMatchingSearchElement(s) ) //seperate method
> to show the resultant elements in a drop down
>
> But this is producing a nil result for s.
>
> The examples in MBS don't seem to cover this type of application.
>
> Can anyone spot what I am doing wrong?
>
> Jim
>
> ------------------------------
>
> Message: 5
> Date: Wed, 16 May 2012 11:21:00 +0200
> From: Christian Schmitz <[email protected]>
> Subject: Re: [MBS] Filter addressBook names within a Group
> To: MBS Real Studio Plugin List <[email protected]>
> Message-ID:
> <[email protected]>
> Content-Type: text/plain; charset=us-ascii
>
>
> Am 15.05.2012 um 21:39 schrieb Jim Pitchford:
>
>>
>> s1=g.searchElementForProperty(a.kABLastNameProperty,"","",names(i),a.kABContainsSubStringCaseInsensitive)
>
> Please use a.searchElementForPersonProperty here.
> g.searchElementForProperty is same as a.searchElementForGroupProperty, which
> does not help here.
>
>> But this is producing a nil result for s.
>>
>> The examples in MBS don't seem to cover this type of application.
>>
>> Can anyone spot what I am doing wrong?
>
>
> I tried the same thing, but it fails here, too.
> Sorry, no idea why this fails.
>
> Greetings
> Christian
>
> --
> Real Studio Conferences, Training and Meetings.
>
> More details and registration here:
> http://www.monkeybreadsoftware.de/realbasic/events/
>
>
>
>
>
>
>
> ------------------------------
>
> Send MBS Plugins mailing list submissions to
> [email protected]
>
> To subscribe or unsubscribe via the World Wide Web, visit
>
> https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info
>
> or, via email, send a message with subject or body 'help' to
> [email protected]
>
> You can reach the person managing the list at
> [email protected]
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Mbsplugins_monkeybreadsoftware.info digest..."
>
> _______________________________________________
> Mbsplugins_monkeybreadsoftware.info mailing list
> [email protected]
> https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info
>
> End of Mbsplugins_monkeybreadsoftware.info Digest, Vol 389, Issue 2
> *******************************************************************
>
_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info