Jump to content

Recommended Posts

Posted
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.

 

Screen Shot 2022-11-15 at 10.16.18.png

Posted (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.

 

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
Posted
% /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>!$_
    }
}

 

Posted
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

 

Posted
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!

  • 4 weeks later...
Posted (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 by Erkut
Posted
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.

Posted (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 

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
  • 1 month later...
Posted
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

  • 1 year later...
Posted
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!

Posted

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

 

  • 2 weeks later...
Posted
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

 

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...