vitor Posted November 15, 2022 Share Posted November 15, 2022 Just now, petebocken said: Can't really figure out a rhyme or reason though. Maybe it’s on contacts with multiple phone numbers. Check the debugger. Link to comment
petebocken Posted November 15, 2022 Share Posted November 15, 2022 5 minutes ago, vitor said: Maybe it’s on contacts with multiple phone numbers. Check the debugger. That's what I thought as well, but it's not. Not sure I see any issues with debugger, but this is the first time I'm using it. Link to comment
pdy Posted November 16, 2022 Share Posted November 16, 2022 (edited) 9 hours ago, petebocken said: That's what I thought as well, but it's not. Not sure I see any issues with debugger, but this is the first time I'm using it. It seems like the regular expression fails to match a phone number. Hi @petebocken, could you post the output of the following command from terminal? /usr/libexec/PlistBuddy -c 'Print:Phone' '/Users/peter/Library/Application Support/AddressBook/Sources/336CF002-F2FC-41D8-B761-68FBD7453613/Metadata/52299394-FE3F-4A59-9F22-73EDC8AADDEA:ABPerson.abcdp' The command basically outputs the phone entry of a given contact. For privacy reason, you can mask part of the phone number. Edited November 16, 2022 by pdy Link to comment
petebocken Posted November 16, 2022 Share Posted November 16, 2022 % /usr/libexec/PlistBuddy -c 'Print:Phone' '/Users/peter/Library/Application Support/AddressBook/Sources/336CF002-F2FC-41D8-B761-68FBD7A53613/Metadata/52299394-FE3F-4A59-9F22-73EDC8AADDEA:ABPerson.abcdp' Dict { identifiers = Array { 5CDBF59B-7C58-433A-99F6-6B5666376541 E3628392-C195-46C1-BE38-F5C3B709A3FD } values = Array { 1 (800) 872-2657 (612) 872-2657 } primary = 5CDBF59B-7C58-433A-99F6-6B5666376541 labels = Array { _$!<Main>!$_ _$!<Work>!$_ } } Link to comment
pdy Posted November 17, 2022 Share Posted November 17, 2022 11 hours ago, petebocken said: % /usr/libexec/PlistBuddy -c 'Print:Phone' '/Users/peter/Library/Application Support/AddressBook/Sources/336CF002-F2FC-41D8-B761-68FBD7A53613/Metadata/52299394-FE3F-4A59-9F22-73EDC8AADDEA:ABPerson.abcdp' Dict { identifiers = Array { 5CDBF59B-7C58-433A-99F6-6B5666376541 E3628392-C195-46C1-BE38-F5C3B709A3FD } values = Array { 1 (800) 872-2657 (612) 872-2657 } primary = 5CDBF59B-7C58-433A-99F6-6B5666376541 labels = Array { _$!<Main>!$_ _$!<Work>!$_ } } I see. In your case, a phone number can contain brackets. Try the following script. query="{query}" phone_num=$(/usr/libexec/PlistBuddy -c 'Print:Phone' "$query" | grep -o -m 1 '^[[:space:]]*\(+\?[[:digit:][:space:])(-]\+\)[:space:]\?$') echo -n $phone_num Link to comment
petebocken Posted November 17, 2022 Share Posted November 17, 2022 1 hour ago, pdy said: I see. In your case, a phone number can contain brackets. Try the following script. query="{query}" phone_num=$(/usr/libexec/PlistBuddy -c 'Print:Phone' "$query" | grep -o -m 1 '^[[:space:]]*\(+\?[[:digit:][:space:])(-]\+\)[:space:]\?$') echo -n $phone_num That works, thanks so much! Link to comment
pdy Posted November 18, 2022 Share Posted November 18, 2022 On 11/17/2022 at 10:20 AM, petebocken said: That works, thanks so much! You are welcome Link to comment
Erkut Posted December 10, 2022 Share Posted December 10, 2022 (edited) Hi, first of all thank you for your great work. i just install the workflow, when i try make a call with contact name, facetime appears and then nothing happening, same thing with message app it starts with new message without any number. But if i write phone number mannually "call 0555 555 55 55 or sms 0555 555 55 55" it's working, same format inside of contacts. i cant understand why. is there a way to fix it? Edited December 10, 2022 by Erkut Link to comment
Joachim Posted December 13, 2022 Share Posted December 13, 2022 On 12/10/2022 at 2:48 PM, Erkut said: Hi, first of all thank you for your great work. i just install the workflow, when i try make a call with contact name, facetime appears and then nothing happening, same thing with message app it starts with new message without any number. But if i write phone number mannually "call 0555 555 55 55 or sms 0555 555 55 55" it's working, same format inside of contacts. i cant understand why. is there a way to fix it? Scroll up and find pdy's post from november 14. He has a solution to the problem. Link to comment
Erkut Posted December 13, 2022 Share Posted December 13, 2022 (edited) Thank you for your reply. But in my case there is something else, when i type the command in the terminal Quote query="{query}" phone_num=$(/usr/libexec/PlistBuddy -c 'Print:Phone' "$query" | grep -o -m 1 '^[[:space:]]*\(+\?[[:digit:][:space:])(-]\+\)[:space:]\?$') echo -n $phone_num it says Quote Print: Entry, ":Phone", Does Not Exist So it can't found "Phone" varrient, Also debug logs here It says there is no Contacts.app but i can see the Contacts.app in the app list and i can reach the contacts via app. Alfred approved reach the contacts. Edited December 13, 2022 by Erkut Link to comment
Karl87 Posted February 1, 2023 Share Posted February 1, 2023 On 11/17/2022 at 2:07 AM, pdy said: I see. In your case, a phone number can contain brackets. Try the following script. query="{query}" phone_num=$(/usr/libexec/PlistBuddy -c 'Print:Phone' "$query" | grep -o -m 1 '^[[:space:]]*\(+\?[[:digit:][:space:])(-]\+\)[:space:]\?$') echo -n $phone_num I have the same issue. Facetime opens and nothing happens. Where would I need to insert this code? Thank you! Karl Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now