andy4222 Posted October 29, 2022 Share Posted October 29, 2022 (edited) Hi, I'm trying to create a workflow that allows me to search my contacts by name and then pass the phone number to the next step in the workflow. How can I accomplish searching the contacts and extracting the phone number I tried to create a file filter with the address as the scope but didn't know how to proceed further. Can anyone please assist me here? Edited October 29, 2022 by andy4222 Link to comment
sepulchra Posted October 31, 2022 Share Posted October 31, 2022 I believe you are looking for a contact action: https://www.alfredapp.com/help/workflows/triggers/contact-action/ Link to comment
andy4222 Posted November 2, 2022 Author Share Posted November 2, 2022 Thanks for answering. I looked at that but I'm not looking for that. I want something that triggers on a keyword and shows me the list of contacts and I can pass out the phone number to the next step (trigger callback url in this case) Link to comment
andy4222 Posted November 4, 2022 Author Share Posted November 4, 2022 (edited) Commenting for visibility Edited November 4, 2022 by andy4222 Link to comment
sepulchra Posted November 4, 2022 Share Posted November 4, 2022 Is there a reason why you would be able to save a contact action as a variable and pass it to a callback url? Here is something i built with a contact action that saves variables and passes to a script: the first variable saves the number from the contact action, and the second variable captures the message i'm sending, and then it hits this script: tell application "Messages" set targetBuddy to (system attribute "number") set targetService to id of 1st account whose service type = iMessage set textMessage to (system attribute "msg") set theBuddy to participant targetBuddy of account id targetService send textMessage to theBuddy end tell I have another that passed a number to an imessage callback url as well. Link to comment
andy4222 Posted November 5, 2022 Author Share Posted November 5, 2022 (edited) If you can share that workflow, I can take a look and see it that works for me. I want something where I can use a keyword, that triggers contact search, and on pressing enter, passes the phone to the next step Edited November 5, 2022 by andy4222 Link to comment
sepulchra Posted November 5, 2022 Share Posted November 5, 2022 unfortunately, I can't send the workflow because of other personal details in that workflow but here's the content of the variables Link to comment
andy4222 Posted November 5, 2022 Author Share Posted November 5, 2022 Thanks, I don't think that would be a solve to my question though @vitor If you could help out, that'd be great. Link to comment
vitor Posted November 7, 2022 Share Posted November 7, 2022 Look inside your search scope. You’ll realise you’re essentially dealing with abcdp files, which are binary plists. You’ll have to parse those and extract the number. Use /usr/libexec/PlistBuddy. For example, /usr/libexec/PlistBuddy -c 'Print :Phone' /path/to/file will dive you a dictionary, in which there’s an array with the numbers. 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