Daniele Posted November 14, 2020 Share Posted November 14, 2020 Hello, is there a workflow to quick add a new contact directly using Alfred? Thanks Link to comment
TomBenz Posted September 14, 2023 Share Posted September 14, 2023 On 11/14/2020 at 4:17 PM, Daniele said: Hello, is there a workflow to quick add a new contact directly using Alfred? Thanks See if this is helpful. I just created workflow to add new contact from selected phone text and using universal text action. 1. Two blocks in workflow as below 2. Applescript code used on run argv set selectedText to item 1 of argv -- Get the selected text (assuming it contains a phone number) -- Prompt for first name, last name, and company display dialog "Please enter Contact’s First Name:" default answer "First Name" set ClientName to text returned of result display dialog "Please Enter Contact’s Last Name:" default answer "Last Name" set LastClientName to text returned of result display dialog "Please enter Contact’s Company:" default answer "Company Name" set companyName to text returned of result -- Create a new contact with the provided information tell application "Contacts" set thePerson to make new person with properties {first name:ClientName, last name:LastClientName} tell thePerson set organization to companyName end tell -- Add the selected text (phone number) as a phone number for the contact make new phone at end of phones of thePerson with properties {label:"mobile", value:selectedText} -- Save the changes save end tell end run 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