苹果系统之Applescript实现FaceTime蓝号检测,无痕检测数据是否开通FaceTime服务

FaceTime是苹果公司iOS和macOS(以前称Mac OS X或OS X)内置的一款视频通话软件,通过Wi-Fi或者蜂窝数据接入互联网,在两个装有FaceTime的设备之间实现视频通话。其要求通话双方均具有装有FaceTime的苹果设备,苹果ID以及可接入互联网的3G/4G/5G或者Wi-Fi网络。

 

、Applescript实现检测功能
1.实现全自动无痕检测手机号或邮箱号是否启用或开通FaceTime服务
/*  需要注意的是:检测是不是FaceTime数据,需要在手机号的前缀 +国家代码即可,检测邮箱号是否开通FaceTime服务则不需要加任何前缀。升级版参考相关文章: https://www.cnblogs.com */
FaceTime蓝号检测代码示例:

--get_ui()
facetime()
 
--获取facetime应用所有ui元素
on get_ui()
 tell application "FaceTime" to activate
	 tell application "System Events"
		 tell process "FaceTime"
			 tell window 1
				 entire contents
			 end tell
		 end tell
	 end tell
end get_ui
 
 
--facetime数据筛选主程序执行
on facetime()
 tell application "Finder" to activate
 tell application "Finder"
	 set chosenfile to (choose file)
 end tell
 
 
 tell application "FaceTime"
	 tell application "FaceTime" to activate
	 
	 set phoneData to read chosenfile
	 set cards to paragraphs of phoneData
	 repeat with phone in cards
		 
		 set num to the length of phone
		 if (num > 0) then
			 my check_data(phone)
			 delay 1
		 end if
	 end repeat
	 
 end tell
end facetime


# 检测数据是否开通或启用facetime
on check_data(phone)
 tell application "System Events"
	 tell process "FaceTime"
		 --核心代码...
	 end tell
 end tell
end check_data


--记录有效数据
on WritePhone(the_phone)
 set num to the length of the_phone
 if (num > 0) then
	 set fileName to date string of (current date)
	 set logFilePath to my current_folder_path() & "success/检测成功的FaceTime数据.txt"
	 set this_file to (POSIX file logFilePath as string)
	 set this_story to the_phone & "
"
	 try
		 set fp to open for access this_file
		 set myText to read fp
		 
		 if (myText does not contain the_phone) then
			 my write_to_file(this_story, this_file, true, true)
		 end if
	 on error
		 my write_to_file(this_story, this_file, true, true)
	  end try
 end if
end WritePhone


--写入文件
on write_to_file(this_data, target_file, append_data, append_end)
 try
	 set the target_file to the target_file as text
	 set the open_target_file to ¬
		 open for access file target_file with write permission
	 
	 if append_data is false then
		 set eof of the open_target_file to 0
		 write this_data to the open_target_file starting at eof
	 else if append_end is false then
		 try
			 set fp to open for access target_file
			 set myText to read fp
			 set eof of the open_target_file to 0
			 write this_data to the open_target_file starting at eof
			 write myText to the open_target_file starting at eof
		 on error
			 write this_data to the open_target_file starting at eof
		 end try
	 else
		 write this_data to the open_target_file starting at eof
	 end if
	 
	 close access the open_target_file
	 return target_file
 on error
	 try
		 close access file target_file
	 end try
	 return false
 end try
end write_to_file


--获取当前文件的父文件夹路径
on current_folder_path()
 set UnixPath to POSIX path of ((path to me as text) & "::")
 return UnixPath
end current_folder_path

 

posted @ 2024-07-27 17:15  沉雪's  阅读(51)  评论(0编辑  收藏  举报