|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Apprentice |
Is there some way to script finding the Me card? I have tried many things. This seems to be the closest:
document := (NSApplication sharedApplication) firstDayliteDocument. objectContext := document objectContext. qual := BDKeyValueQualifier keyValueQualifierWithKey:'name' operatorSelector:#isEqualTo: value:'Me'. users := objectContext objectsForEntityNamed:'User' matchingQualifier:qual. users == nil ifTrue: [ NSNumber numberWithBool:0. ] ifFalse: [ ((users objectAtIndex:0) valueForKeyPath:'rawRow') description. ]. but it doesn't find me. If I use this: document := (NSApplication sharedApplication) firstDayliteDocument. objectContext := document objectContext. users := objectContext objectsForEntityNamed:'User'. users name. I do get an array that includes the Me contact as the last object. Is it always the last object? I have tried iterating through the users returned in this second method and comparing their name to 'Me' but that never resolves as true. Thanks, Jon Nathan |
||
|
|
Marketcircle Team |
'Me' is the current user in Daylite.
You can get the current user by one of two techniques. You can ask the document or the objectContext for the currentUser. document := (NSApplication sharedApplication) firstDayliteDocument. meUser := document currentUser. meContact := meUser contact. Since a user is a person, the person's details are in a contact object that is attached to the user object. Hope this makes sense. |
|||
|
|
Apprentice |
Perfect. Thanks!
|
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|

