博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
AppleScript脚本
阅读量:4114 次
发布时间:2019-05-25

本文共 785 字,大约阅读时间需要 2 分钟。

1, 打开程序后, 模拟手键盘的输入(模拟tab键, 模拟依次按键, 以及按住Command+V键)

tell application "Mail"

activate

set theMessage to make new outgoing message with properties {

visible:true, subject:"mysubject"}

end tell

tell application "System Events"

tell process "Mail"

-- repeat until focused of UI element 1 of scroll area 4 of window 1

-- keystroke tab

-- end repeat

keystroke "yiono"

--keystroke "v" using command down

end tell

end tell

2,  模拟菜单打开操作, 打开photo Booth应用,然后执行一个拍照的操作

tell application "Photo Booth"

activate

end tell

tell application "System Events"

tell process "Photo Booth"

delay 3

tell application "Finder"

set visible of process "Photo Booth" to false

end tell

tell menu bar 1

tell menu bar item "File"

tell menu "File"

click menu item "Take Photo"

end tell

end tell

end tell

end tell

end tell

转载地址:http://otwpi.baihongyu.com/

你可能感兴趣的文章
Unix 命令,常用到的
查看>>
DLL中建立进程共享数据段需要注意的语法问题
查看>>
服务器端技术----Http请求的处理过程
查看>>
C语言-预处理指令2-条件编译
查看>>
C语言-预处理指令3-文件包含
查看>>
C语言-变量类型
查看>>
C语言-static和extern关键字1-对函数的作用
查看>>
C 语言-static和extern关键字2-对变量的作用
查看>>
没看错!用游戏测试人工智能。
查看>>
centos7 mysql服务器安装
查看>>
解决UBUNTU 边栏消失问题
查看>>
通过SSH和proxyChain连接内网SVN
查看>>
wget 编译出错解决mips
查看>>
crontab 使用方法
查看>>
centos 64位下编译遇到的问题
查看>>
centos7 xfs分区重调整
查看>>
Makefile:418: *** 混和的隐含和普通规则。 停止。
查看>>
.config 找不到?
查看>>
ld: crti.o: No such file
查看>>
vim正则表达式
查看>>