关于MacBook的几个快捷键

回头想想挺可悲的,增删改查这么多年。只有两个功能帮助了我生活工作,通过AppleScript实现。 19年写的,现在我还一直在用,还挺好用,有需要的可以试一下。
AppleScript+自动操作+快捷键

  1. 清空垃圾桶:wastebasket:
  2. 通过终端连接服务器:white_check_mark:

1、清空垃圾桶:wastebasket:

tell application "Finder" #调用Finder程序
empty the trash #去清空回收站里面的垃圾
end tell #结束调用程序

2、通过终端连接服务器

tell application "Terminal"
	do script "ssh  [email protected]"
	delay 0.8
	tell application "System Events"
		tell process "Terminal"
			set frontmost to true
			delay 1
			keystroke "password"
			keystroke return
		end tell
	end tell
end tell

感谢分享


如果能用代码块括起来就好了,而且提供的代码的引号有问题

tell application "Finder"
empty the trash
end tell

感谢反馈

感谢反馈,我刚开始在这个平台写东西。还多功能还不熟。谢谢

怎么把密码写脚本里了?好歹整个key. 还有这个 delay 1, 如果服务器一秒内没有反应,密码不是直接显示到屏幕了?

有道理稍后我改一下。谢谢反馈