tags: AppleScript, Contacts
這個(gè)簡(jiǎn)單的只有一行的AppleScript,可以返回當(dāng)前所選聯(lián)系人的電話號(hào)碼,比如下面選擇的這個(gè)聯(lián)系人:中國(guó)銀行
它有兩個(gè)號(hào)碼,一個(gè)標(biāo)簽為work,另一個(gè)標(biāo)簽

Contacts.png
tell application "Contacts"
get value of phones of item 1 of (get selection) whose label is "mobile"
-- 這里的 'mobile' 標(biāo)簽表示獲取BOC的'手機(jī)'的號(hào)碼,即021-95566
end tell
或者
tell application "Contacts"
get value of phones of item 1 of (get selection) whose label is "work"
-- 同理這里的 'work' 標(biāo)簽表示獲取BOC的工作電話,即400 669 5569
end tell