我想使用Applescript在app typora上重复导出markdown到HTML的过程
我觉得可以分成两部分
第一步:点击导出到HTML第二步:选择目标目录并点击保存
但我对第一步有个问题
tell application "System Events"
tell application "Typora"
open "path/to/my/markdown.md"
end tell
tell process "Typora"
click (menu item "HTML" of menu "export" of menu item "export" of menu "file" of menu bar item "file" of menu bar 1)
end tell
end tell此代码不起作用。运行此脚本后,未弹出任何窗口(要求我选择目标目录
发布于 2020-12-02 22:39:38
这对我来说很有效:
activate application "Typora"
delay 1
tell application "System Events"
tell process "Typora"
click (menu item "HTML" of menu "export" of menu item "export" of menu "file" of menu bar item "file" of menu bar 1)
delay 1
click button "Save" of sheet 1 of window 1
click button "Replace" of sheet 1 of sheet 1 of window 1
end tell
end tell查找更多UI元素的一个有用命令是:entire contents of window 1
https://stackoverflow.com/questions/64159791
复制相似问题