一、實現iMessage藍號資料篩選的兩種方式:
1.人工篩選,將要驗證的號碼輸出到檔案中,以逗號分隔。再將檔案中的號碼貼上到iMessage客戶端的位址列,iMessage客戶端會自動逐個檢驗該號碼是否為iMessage賬號,檢驗速度視網速而定。紅色表示不是iMessage賬號,藍色表示iMessage賬號。
2.編寫指令碼控制Mac os/iphone上自帶的iMessage應用進行驗證(全自動無痕跡檢測,無需人工干預),將資料自動填充到號碼框之後,如果捕獲到失敗則不是iMessage賬號,捕獲到成功則把資料儲存下來。
3.最新升級版本請參考博文首頁相關文章: https://www.cnblogs.com/imblog/
二、指令碼程式或app對指定資料全自動無痕過濾
Mac OS系統下無痕檢測手機號是否註冊imessage的程式(注意:檢測不同國家手機號需要在手機號的字首 +國家程式碼即可,自動檢測匯入的txt資料,藍號資料自動儲存,新升級版經測試單app id可檢測1000+條)
檢測資料是否開通imessge示例程式碼:
1 -- 全自動無痕檢測匯入的資料是否註冊imesaages
2 startApp()
3
4
5 --執行主程式
6 on startApp()
7 tell application "Finder" to activate
8
9 tell application "Finder"
10 set chosenfile to (choose file)
11 end tell
12
13 tell application "Messages"
14 tell application "Messages" to activate
15
16 set phoneData to read chosenfile
17 set cards to paragraphs of phoneData
18
19 repeat with phone in cards
20 --set msgText to (my AppendFace(" "))
21
22 -- 假如字串大於0,則草率判定是手機號
23 set num to the length of phone
24 if (num > 0) then
25 --執行檢測
26 my sendMsg(phone)
27 delay 1
28 end if
29 end repeat
30 display dialog "恭喜,資料已全部檢測完畢!"
31 end tell
32 end startApp
33
34
35 # 開始檢測
36 on sendMsg(phone)
37 tell application "Messages" to activate
38 tell application "System Events"
39 tell process "Messages"
40 tell window 1
41 --核心程式碼,省略.........
42
43 if static text of sheet 1 of window "資訊" of application process "Messages" of application "System Events" exists then
44 --對未啟用imessage的手機號碼進行記錄
45 my WritePhone(phone, "未開啟im的資料.txt")
46 else
47 --對已啟用imessage的手機號碼進行記錄
48 my WritePhone(phone, "已開啟im的資料.txt")
49 end if
50
51
52 delay 0.2
53 key code 76
54
55
56 end tell
57 end tell
58 end tell
59 end sendMsg
60
61
62 -- 記錄有效手機號
63 on WritePhone(the_phone, file_name)
64 set num to the length of the_phone
65 if (num > 0) then
66 set fileName to date string of (current date)
67 set logFilePath to my current_folder_path() & "send/" & file_name
68 set this_file to (POSIX file logFilePath as string)
69 set this_story to the_phone & "
70 "
71 try
72 set fp to open for access this_file
73 set myText to read fp
74
75 if (myText does not contain the_phone) then
76 my write_to_file(this_story, this_file, true, true)
77 end if
78 on error
79 my write_to_file(this_story, this_file, true, true)
80 end try
81 end if
82 end WritePhone
83
84
85 -- 寫入檔案
86 on write_to_file(this_data, target_file, append_data, append_end)
87 try
88 set the target_file to the target_file as text
89 set the open_target_file to ¬
90 open for access file target_file with write permission
91
92 if append_data is false then
93 set eof of the open_target_file to 0
94 write this_data to the open_target_file starting at eof
95