tell application "MarginNote 3"
tell front notebook
set noteids to note ids
set weid to item 1 of noteids
set weidiction to fetch dictionaries weid
set targetNote to item 1 of weidiction
set title of targetNote to excerpt text of targetNote
set excerpt text of targetNote to ""
set weidiction to targetNote
end tell
end tell
tell application "MarginNote 3"
# 获取当前查看的笔记本
set nbk to item 1 of (search notebook "") # 搜索最近新查看的笔记本,即当前打开的笔记本
set nLst to notes of nbk # 获取笔记本里的全部笔记
# 对笔记本中所有笔记执行循环
repeat with n in nLst
set x to excerpt text of n # 使用1个临时变量x来储存笔记的摘录文本
set title of n to x # 将笔记的标题设置为摘录文本
set excerpt text of n to "" # 将笔记的摘录文本设置为空
end repeat
end tell
指定单张卡片执行:摘录转标题
tell application "MarginNote 3"
# 获取当前查看的笔记本
set nbk to id of item 1 of (search notebook "") # 搜索最近新查看的笔记本,即当前打开的笔记本
set n to item 1 of (search note in notebook nbk text "For example, when children receive low grades") # 获取笔记本里包含特定内容的指定卡片
set x to excerpt text of n # 使用1个临时变量x储存指定卡片的标题
set title of n to x # 将指定卡片标题设置为摘录的内容
set excerpt text of n to "" # 清空指定卡片的摘录文本
end tell