PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Sunday, November 6, 2022

[FIXED] How do I add a Name Prefix to a Contact using AppleScript?

 November 06, 2022     applescript, contacts, macos     No comments   

Issue

Apple's Contacts App had a defined field for a name prefix (e.g. "Dr.").

Using AppleScript if I retrieve the name property, the prefix is included. However, there does not appear to be/exist a prefix property. There IS a suffix property which I am able to read and write, but I need to be able to specifically WRITE (e.g. add) a prefix to a contact.

Any/All help would be appreciated!!


Solution

In the AppleScript dictionary (⇧⌘L ) for Contacts, look at the properties of the class Person.

If you have added a Prefix to the contact via, e.g., Contacts > Card > Add Field, then it is assigned to the title property.

Example AppleScript code:

tell application "Contacts"
    set theContact to the first person ¬
        whose title is not missing value
    return title of theContact
end tell


Answered By - user3439894
Answer Checked By - Marie Seifert (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing