一、检测数据的两种方式:
1.人工筛选,将要验证的号码输出到文件中,以逗号分隔。再将文件中的号码粘贴到iMessage客户端的地址栏,iMessage客户端会自动逐个检验该号码是否为iMessage账号,检验速度视网速而定。红色表示不是iMessage账号,蓝色表示iMessage账号。
2.编写脚本控制Mac os/iphone上自带的iMessage应用进行验证(全自动检测,无需人工干预),类似于群发iMessage;发送一条iMessage之后,如果捕获到发送失败的异常则不是iMessage账号,捕获到发送成功则把数据保存下来。
二、脚本或app对指定数据全自动过滤
1.电脑版检测数据是否imessages脚本(自动检测导入的txt数据,蓝色的手机号数据自动保存,有意联系企鹅号: 2632313923)
电脑版检测脚本代码示例:
1 startApp()
2
3 on clickOk()
4 tell application "Messages" to activate
5 tell application "System Events"
6 tell process "Messages"
7 tell window 1
8 entire contents
9 end tell
10 end tell
11 end tell
12 end clickOk
13
14
15 on startApp()
16 tell application "Finder" to activate
17
18 tell application "Finder"
19 set chosenfile to (choose file) --选择制定需要检测的数据例如: phone.txt
20 end tell
21
22 tell application "Messages"
23 tell application "Messages" to activate
24
25 set phoneData to read chosenfile
26 set cards to paragraphs of phoneData
27
28 repeat with phone in cards
29 --set msgText to (my AppendFace(" "))
30
31 -- 假如字符串不是11位,则草率判定不是手机号
32 set num to the length of phone
33 if (num > 0) then
34 --执行发送
35 my sendMsg(phone, ".")
36 delay 1
37
38 # 及时删除多余的消息
39 set chatNum to (get count of chat)
40 if chatNum is greater than 1 then
41 my deleteMsg(chatNum, phone)
42 end if
43
44 end if
45 end repeat
46
47 end tell
48 end startApp
49
50
51 # 发送信息
52 on sendMsg(phone, msg)
53 tell application "System Events"
54 tell process "Messages"
55 tell window 1
56 delay 0.2
57 key code 55 & 45
58 --核心代码,省略.........
59 end tell
60 end tell
61 end tell
62 end sendMsg
63
64
65 # 删除信息
66 on deleteMsg(maxNum, thisphone)
67 tell application "Messages" to activate
68
69 tell application "System Events"
70 tell process "Messages"
71 tell window 1
72 repeat maxNum times
73
74 delay 0.2 -- 延时0.5秒
75 click row 1 of table 1 of scroll area 1 of splitter group 1 --选中第一个会话
76 delay 0.2 -- 延时0.5秒
77 click menu item "删除对话…" of menu "文件" of menu bar item "文件" of menu bar 1 of application process "Messages" of application "System Events"
78 --激活右键菜单中的删除对话
79 delay 0.2 -- 延时0.5秒
80
81 try
82 click button "删除" of sheet 1
83 --对启用了imessage功能的手机号码进行记录
84 my WritePhone(thisphone)
85
86 end try
87 end repeat
88 end tell
89 end tell
90 end tell
91 end deleteMsg
92
93
94
95 -- 记录有效手机号
96 on WritePhone(the_phone)
97 set num to the length of the_phone
98 if (num > 0