Jump to content

Recommended Posts

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.

 

Screen Shot 2022-11-15 at 10.16.18.png

 

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 by pdy
Link to comment
% /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
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
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
  • 4 weeks later...

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 by Erkut
Link to comment
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

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 

67124514_Screenshot2022-12-13at22_19_13.thumb.jpg.72d7fd2ac63468e7f5bd54f649fa8b8c.jpg

 

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 by Erkut
Link to comment
  • 1 month later...
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...