将名字、中间名和姓氏合并为一个名字的简单方法

发布于 2024-10-27 19:02:31 字数 169 浏览 0 评论 0原文

示例:

  • 名字:“Sandu”
  • 中间名:“D”。
  • 姓氏:“Serban”

结果将类似于:“Sandu_D._Serban”

对于我的 Mac 地址簿中的所有联系人,

。谢谢

Example:

  • First Name: "Sandu"
  • Middle Name: "D."
  • Last Name: "Serban"

The result would be something like: "Sandu_D._Serban"

For all the contacts in my Mac Address Book.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执笔绘流年 2024-11-03 19:02:31

使用 applescript,您可以这样做(使用脚本编辑器运行):

    tell application "Address Book"
        set allNames to ""
        set peopleCount to (count every person)
        repeat with i from 1 to peopleCount
            set firstName to (get first name of person i)
            set middleName to (get middle name of person i)
            set lastName to (get last name of person i)
            set oneName to ""
            if firstName is not missing value then
                set oneName to oneName & firstName
            end if
            if middleName is not missing value then
                set initial to first character of middleName
                set oneName to oneName & "_" & initial & "."
            end if
            if lastName is not missing value then
                set oneName to oneName & "_" & lastName & "
    "
            end if
            if firstName is missing value or lastName is missing value then
                set oneName to ""
            end if
            set allNames to allNames & oneName
        end repeat
        set the clipboard to allNames
    end tell

该脚本将姓名列表复制到剪贴板。下次粘贴时,您将获得姓名列表(如果地址簿中有很多姓名,请稍等一下)。

br,

尤哈

With applescript you can do it like this (use script editor to run):

    tell application "Address Book"
        set allNames to ""
        set peopleCount to (count every person)
        repeat with i from 1 to peopleCount
            set firstName to (get first name of person i)
            set middleName to (get middle name of person i)
            set lastName to (get last name of person i)
            set oneName to ""
            if firstName is not missing value then
                set oneName to oneName & firstName
            end if
            if middleName is not missing value then
                set initial to first character of middleName
                set oneName to oneName & "_" & initial & "."
            end if
            if lastName is not missing value then
                set oneName to oneName & "_" & lastName & "
    "
            end if
            if firstName is missing value or lastName is missing value then
                set oneName to ""
            end if
            set allNames to allNames & oneName
        end repeat
        set the clipboard to allNames
    end tell

This script copies the name list to clipboard. Next time you paste you get the name list (wait a bit if you have a lot of names in your address book).

br,

Juha

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文