vitor Posted November 15, 2022 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.
petebocken Posted November 15, 2022 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.
pdy Posted November 16, 2022 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
petebocken Posted November 16, 2022 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>!$_ } }
pdy Posted November 17, 2022 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
petebocken Posted November 17, 2022 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!
pdy Posted November 18, 2022 Posted November 18, 2022 On 11/17/2022 at 10:20 AM, petebocken said: That works, thanks so much! You are welcome
Erkut Posted December 10, 2022 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
Joachim Posted December 13, 2022 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.
Erkut Posted December 13, 2022 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
Karl87 Posted February 1, 2023 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
antoniorodr Posted November 11 Posted November 11 Hello! I got this working, but I need to have the contacts app open. Is there a way to do this without having to have the Contacts app open beforehand @amoose136?
sepulchra Posted November 11 Posted November 11 @antoniorodr I just looked at the github page for this workflow and it appears it is no longer being developed.
antoniorodr Posted November 11 Posted November 11 28 minutes ago, sepulchra said: @antoniorodr I just looked at the github page for this workflow and it appears it is no longer being developed. Yeah it’s seems so. Maybe I just need to learn how the workflows work and fork the project and fix it. We will see!
antoniorodr Posted November 12 Posted November 12 I think I managed to solve the problem (I've not tested it properly yet). Replace the script the workflow has for the calls with this one: on alfred_script(q) -- Open Contacts app to retrieve information tell application "Contacts" to activate -- Extract contact ID by removing "Metadata/" from the input set contactID to text ((offset of "Metadata/" in q) + 9) thru ((offset of "." in q) - 1) of q try tell application "Contacts" set contact to person id contactID set phoneNumbers to value of every phone of contact -- Check if there are any phone numbers available if (count of phoneNumbers) > 0 then set phonenumber to item 1 of phoneNumbers -- Initiate call via FaceTime do shell script "open 'tel:" & phonenumber & "'" else return "No phone numbers available for this contact." end if end tell on error return "Could not find a contact with the specified ID." end try -- Close the Contacts app after retrieving the phone number tell application "Contacts" to quit -- Close the Alfred search bar using Command + Space tell application "System Events" key down command keystroke space key up command end tell end alfred_script
antoniorodr Posted November 12 Posted November 12 @sepulchra could you test my solution to see if it works for you too?
sepulchra Posted November 13 Posted November 13 I don’t use this workflow but hopefully someone else in the thread can test for you. antoniorodr 1
melomon Posted November 26 Posted November 26 I would help test, but I need a step by step guide to install it. Is the fix based on the old https://github.com/amoose136/call_or_sms_contact or on https://github.com/c-stephens/Call-or-Message-Contact?
antoniorodr Posted November 27 Posted November 27 14 hours ago, melomon said: I would help test, but I need a step by step guide to install it. Is the fix based on the old https://github.com/amoose136/call_or_sms_contact or on https://github.com/c-stephens/Call-or-Message-Contact? Hi, The first one which is the same as the original here. This is the workflow I use with the fix: https://transfer.archivete.am/11pfaD/Call or SMS contact.alfredworkflow melomon 1
melomon Posted Wednesday at 06:16 PM Posted Wednesday at 06:16 PM 11 hours ago, antoniorodr said: Hi, The first one which is the same as the original here. This is the workflow I use with the fix: https://transfer.archivete.am/11pfaD/Call or SMS contact.alfredworkflow Thank you! I downloaded your fixed workflow and will test it, and provide feedback when I have. antoniorodr 1
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