将一下内容保存为iTunes.scpt,并运行

set question to display dialog "确定是否删除 iTunes ?" buttons {"Yes", "No"} default button 1
set answer to button returned of question
if answer is equal to "Yes" then
do shell script "rm -rf /Applications/iTunes.app" with administrator privileges
display dialog "iTunes 已删除" buttons {"OK"}
set theDMG to choose file with prompt "请选择 iTunes 12.6 dmg 安装文件:" of type {"dmg"}
do shell script "hdiutil mount " & quoted form of POSIX path of theDMG
do shell script "pkgutil --expand /Volumes/iTunes/Install\\ iTunes.pkg ~/tmp"
do shell script "sed -i '' 's/18A1/14F2511/g' ~/tmp/Distribution"
do shell script "sed -i '' 's/gt/lt/g' ~/tmp/Distribution"
do shell script "pkgutil --flatten ~/tmp ~/Desktop/iTunes.pkg"
do shell script "hdiutil unmount /Volumes/iTunes/"
do shell script "rm -rf ~/tmp"
end if
if answer is equal to "No" then
display dialog "iTunes 未删除" buttons {"OK"}
return
end if set question to display dialog "确定是否安装 iTtunes 12.6 ?" buttons {"Yes", "No"} default button 1
set answer to button returned of question
if answer is equal to "Yes" then
do shell script "open ~/Desktop/iTunes.pkg"
return
end if
if answer is equal to "No" then
display dialog "已修改的 iTunes.pkg 文件保存在桌面" buttons {"OK"}
return
end if
参考资料:https://tinyurl.com/y33j2pwt https://forums.macrumors.com/threads/apples-special-version-of-itunes-that-still-has-an-app-store-currently-incompatible-with-macos-mojave.2143244/page-4#post-26592234

最新文章

  1. Centos6下安装高版本Git
  2. 从excel文件中获取数据(2)
  3. BGP--边界网关协议
  4. BZOJ3578 : GTY的人类基因组计划2
  5. NeHe OpenGL教程 第三十六课:从渲染到纹理
  6. hive 0.11的安装配置
  7. 【转】Linux 技巧: Bash 参数和参数扩展
  8. 【Stage3D学习笔记续】山寨Starling(五):纹理计算和尺寸计算
  9. 5shift shell
  10. 大道至简第一章读后感——java伪代码形式
  11. .7-Vue源码之AST(3)
  12. mongodb的TTL索引介绍(超时索引)
  13. java如何编写多线程
  14. 《Apache Kafka实战》读书笔记-调优Kafka集群
  15. RelativeLayout的16种特有属性
  16. php分享二十八:mysql运行中的问题排查
  17. discuz注册页修改
  18. Tensorflow笔记——神经网络图像识别(五)手写数字识别
  19. Layui:前后端分离之Form表单
  20. 部署zookeeper集群

热门文章

  1. centos7安装oracle1201c
  2. 小记--------spark资源调度机制源码分析-----Schedule
  3. 编译错误ERROR C2027
  4. Linux就该这么学——新手必须掌握的命令之文件编辑命令组
  5. Vasya and Endless Credits CodeForces - 1107F (二分图完美匹配)
  6. 【weixin】微信企业号和公众号区别和关系是什么?
  7. 这周末又参加班里同学生日party,同学父母包场2小时花费大约1000美金左右。
  8. 打印从1到最大的n位数(考虑大数问题)
  9. Java8 常用Function、Predicate、Consumer、Supplier接口
  10. 09 SSH原理与远程登录实现方式