【问题标题】:how to use applescript export markdown to html in typora如何在typora中使用applescript将markdown导出到html
【发布时间】:2020-12-02 22:39:38
【问题描述】:

我想用Applescript在apptypora上重复导出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

此代码不起作用。运行此脚本后没有弹出窗口(要求我选择目标目录)

【问题讨论】:

    标签: applescript


    【解决方案1】:

    这对我有用:

    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

    【讨论】:

      猜你喜欢
      • 2020-05-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-25
      • 1970-01-01
      • 2019-02-20
      • 2013-07-09
      • 1970-01-01
      相关资源
      最近更新 更多