Here is what I now have%
getContactInfo (3)
A1: Variable Set [ Name:%par1 To:+2347086458888 Recurse Variables:Off Do Maths:Off Append:Off ]
A2: Java Function [ Return:cr Class Or Object:CONTEXT Function:getContentResolver
{ContentResolver} () Param: Param: Param: Param: Param: Param: Param: ]
A3: Java Function [ Return:u Class Or Object:Uri Function:parse
{Uri} (String) Param:content://com.android.contacts/phone_lookup Param: Param: Param: Param: Param: Param: ]
A4: Java Function [ Return:utel Class Or Object:Uri Function:encode
{String} (String) Param:%par1 Param: Param: Param: Param: Param: Param: ]
A5: Java Function [ Return:uri Class Or Object:Uri Function:withAppendedPath
{Uri} (Uri, String) Param:u, utel Param: Param: Param: Param: Param: Param: ]
A6: Java Function [ Return:res Class Or Object:cr Function:query
{Cursor} (Uri, String[], String, String[], String) Param:uri Param: Param: Param: Param: Param: Param: ]
A7: Java Function [ Return:%exists Class Or Object:res Function:moveToFirst
{boolean} () Param: Param: Param: Param: Param: Param: Param: ]
A8: If [ %exists ~ true ]
A9: Java Function [ Return:%colnames Class Or Object:res Function:getColumnNames
{String[]} () Param: Param: Param: Param: Param: Param: Param: ]
A10: Variable Set [ Name:%colNames To:%colnames(:) Recurse Variables:Off Do Maths:Off Append:Off ]
A11: Java Function [ Return:nameid Class Or Object:res Function:getColumnIndex
{int} (String) Param:display_name Param: Param: Param: Param: Param: Param: Param: Param: Param: Param: Param: Param: ]
A12: Java Function [ Return:picid Class Or Object:res Function:getColumnIndex
{int} (String) Param:Param:photo_uri Param: Param: Param: Param: Param: Param: Param: Param: Param: Param: Param: Param: ]
A13: Java Function [ Return:%out1 Class Or Object:res Function:getString
{String} (int) Param:Param:nameid Param: Param: Param: Param: Param: Param: Param: Param: Param: Param: Param: Param: ]
A14: Java Function [ Return:%out2 Class Or Object:res Function:getString
{String} (int) Param:Param:picid Param: Param: Param: Param: Param: Param: Param: Param: Param: Param: Param: Param: ]
A15: Variable Join [ Name:%out Joiner:, Delete Parts:On ]
A16: Return [ Value:%out Stop:On ]
A17: Else
A18: Return [ Value:-1 Stop:On ]
A19: End If
When I run it I get this error at A5:
20.51.07/E Java Function: uri -> uri
20.51.07/JU analyse: target: Uri expected: null
20.51.07/JU target: analyse done: Uri: class: android.net.Uri obj: null partWithoutMods: null static: true const false casted: false
20.51.07/JU analyse: returnval: android.net.Uri expected: null
20.51.07/JU returnval: analyse done: android.net.Uri: class: android.net.Uri obj: null partWithoutMods: null static: true const false casted: false
20.51.07/JU initClass: class: android.net.Uri obj: null partWithoutMods: android.net.Uri static: true const false casted: false
20.51.07/JU initClass: retnovar: init with array handling -> class android.net.Uri
20.51.07/JU initClass: class: android.net.Uri obj: null partWithoutMods: android.net.Uri static: true const false casted: false
20.51.07/JU initClass: target: init with array handling -> class android.net.Uri
20.51.07/JU analyse: param0: u, utel expected: class android.net.Uri
20.51.07/JU param0: analyse done: u, utel: class: ??? obj: null partWithoutMods: null static: false const false casted: false
20.51.07/E param 0 class: class android.net.Uri
20.51.07/E param 1 class: class java.lang.String
20.51.07/E targetClass: class android.net.Uri
20.51.07/E object: null
20.51.07/E method: public static android.net.Uri android.net.Uri.withAppendedPath(android.net.Uri,java.lang.String)
20.51.07/E arg0 class null value null
20.51.07/E arg1 class null value null
20.51.07/E Java Function: java.lang.reflect.InvocationTargetException
20.51.07/ Caused by: java.lang.NullPointerException
20.51.07/ android.net.Uri.withAppendedPath(Uri.java:2291)
20.51.07/ java.lang.reflect.Method.invokeNative(Native Method)
20.51.07/ java.lang.reflect.Method.invoke(Method.java:525)
20.51.07/ net.dinglisch.android.taskerm.ExecuteService.c(Unknown Source)
20.51.07/ net.dinglisch.android.taskerm.ExecuteService.a(Unknown Source)
20.51.07/ net.dinglisch.android.taskerm.ExecuteService.a(Unknown Source)
20.51.07/E result: stop task (error)
20.51.07/E Error: 1
20.51.07/MacroEdit action finished exeID 1 action no 4 code 664 status: Err next 4
--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/4VneJMJvp8U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.
Here is what I now have%
getContactInfo (3)
A1: Variable Set [ Name:%par1 To:+********** (dont know if you or mod can edit and remove the phone number
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Hurray! Now no errors! Thanks!
What modifications do I need to make to get other info, especially from a custom field in the Google Contacts?
To unsubscribe from this group and all its topics, send an email to tasker+unsubscribe@googlegroups.com.
Many thanks again. I modified your procedure to list all available columns in the phone_lookup table. The challenge now is to know which table contains the custom fields, which is what I really need for my project.
this task converts number to contactname
Do you have an idea of the SQL parameters to get information on <b>custom</b> fields in the Contacts?
This thread has kinda gone "off topic"......
LUCKILY I think I have got around the problem with my name vs. Number problem by using the name.
It seems the name is the number if there is no name specified in the "phone book".
(monitored)--
I couldn't/didn't find that ORIGINALLY and so I asked....Yeah, Graphic.....Things are easy in retrospect.
On 11 January 2017 at 07:35, Graphic <flaviode...@gmail.com> wrote:
If you had checked the userguide you would have known this:Text From/Date/Subject/Time(monitored)"Name is set to sender address if no contact could be looked up."Using Flashes in actions and checking the userguide will resolve alot of issues...
--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/4VneJMJvp8U/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at https://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.
Some of the great capabilities are documented in the less obvious places and some not documented at all. Honestly, I would never have thought that querying Contacts for info would be under "Test Phone" - especially when there is actually an Action called "Contacts". The latest UserGuide does not even say exactly what information you could get under "Test Phone" - it just says "Test something phone related". So some of us should be forgiven for asking questions that are already answered by Tasker!
You make valid points.
Just in case Pent wants to address the specific issue of "Test Phone", I suggest to move all the stuff there to the Action called "Contacts", rename that action "Query Contacts", and reserve the "Test Phone" action for querying the capabilities of the phone. Just a suggestion.
--