回答:
ApplescriptはOS Xアドレス帳のエントリを一括作成できます。これをiPhoneにインポートできます。私はあなたのために基本的なものを作りました:
-- Change these to your desired data
set firstName to "Test"
set lastName to "User"
set numberOfEntries to "5" as integer
set counter to "1" as integer
tell application "Address Book"
repeat numberOfEntries times
set thePerson to make new person with properties {first name:firstName, last name:lastName & " " & counter}
make new email at end of emails of thePerson with properties {label:"Work", value:"test" & counter & "@example.com"}
make new address at end of addresses of thePerson with properties {label:"Home", city:"Fakeville", street:(counter as string) & " Some St."}
set counter to counter + 1
end repeat
save
end tell
AppleScriptエディター(Applications/Utilities/
フォルダー内)を開き、それを新しいスクリプトに貼り付けます。そのままでは、次のように5つの番号付き連絡先が作成されます。
set numberOfEntries to "5" as integer
行の数を必要な数に変更し、必要に応じてデータを変更できます。他のフィールド(電話番号など)が必要な場合は、お問い合わせください。その方法を紹介します。
私は少し行き過ぎて、より良い名前が付いたバージョンを作りました。私は20の最も人気のある男性と女性の名前、40の最も人気のある姓を使用し、ミドルイニシャルを追加したので、重複の可能性はかなり低くなります(私の計算では2000年のセットで5%未満)、間抜けな番号付き連絡先。
また、すべての連絡先をグループ(「テストグループ」)に追加するため、既存のアドレス帳に追加して後でクリーンアップする場合は、すべての連絡先を簡単に選択できます。
編集:作成するアイテムの数を要求するように変更したので、コードを編集する必要はありません。
-- name lists: 20 most popular (US) male and female first names, 40 most popular last names
set firstNameList to {"Mary", "Patricia", "Linda", "Barbara", "Elizabeth", "Jennifer", "Maria", "Susan", "Margaret", "Dorothy", "Lisa", "Nancy", "Karen", "Betty", "Helen", "Sandra", "Donna", "Carol", "Ruth", "Sharon", "James", "John", "Robert", "Michael", "William", "David", "Richard", "Charles", "Joseph", "Thomas", "Christopher", "Daniel", "Paul", "Mark", "Donald", "George", "Kenneth", "Steven", "Edward", "Brian"}
set lastNameList to {"Smith", "Johnson", "Williams", "Jones", "Brown", "Davis", "Miller", "Wilson", "Moore", "Taylor", "Anderson", "Thomas", "Jackson", "White", "Harris", "Martin", "Thompson", "Garcia", "Martinez", "Robinson", "Clark", "Rodriguez", "Lewis", "Lee", "Walker", "Hall", "Allen", "Young", "Hernandez", "King", "Wright", "Lopez", "Hill", "Scott", "Green", "Adams", "Baker", "Gonzalez", "Nelson", "Carter"}
set initialList to "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
set counter to "1" as integer
-- prompt for how many contacts to create
set dialogText to "Number of contacts to create?"
repeat
display dialog dialogText default answer ""
set numberOfEntries to text returned of result
try
if numberOfEntries = "" then error
set numberOfEntries to numberOfEntries as number
exit repeat
on error
end try
end repeat
-- populate the address book
tell application "Address Book"
set theGroup to make new group with properties {name:"Test Group"}
repeat numberOfEntries times
set firstName to some item of firstNameList
set lastName to some item of lastNameList
set middleInitial to some item of initialList & "."
set thePerson to make new person with properties {first name:firstName, middle name:middleInitial, last name:lastName}
make new email at end of emails of thePerson with properties {label:"Work", value:firstName & middleInitial & lastName & "@example.com"}
make new address at end of addresses of thePerson with properties {label:"Home", city:"Fakeville", street:(counter as string) & " Some St."}
add thePerson to theGroup
set counter to counter + 1
end repeat
save
end tell
これが生成するものです: