首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何在typora中使用applescript导出markdown到html

如何在typora中使用applescript导出markdown到html
EN

Stack Overflow用户
提问于 2020-10-02 00:42:12
回答 1查看 98关注 0票数 0

我想使用Applescript在app typora上重复导出markdown到HTML的过程

我觉得可以分成两部分

第一步:点击导出到HTML第二步:选择目标目录并点击保存

但我对第一步有个问题

代码语言:javascript
运行
复制
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

此代码不起作用。运行此脚本后,未弹出任何窗口(要求我选择目标目录

EN

回答 1

Stack Overflow用户

发布于 2020-12-02 22:39:38

这对我来说很有效:

代码语言:javascript
运行
复制
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

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64159791

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档