永久网站建设营销文案
MAC一键导出PPT备注
- 1.搜索自动操作
- 2.点击快速操作
- 3.搜索并运行`AppleScript`
- 4.输入代码,并选择只应用于Microsoft PowerPoint for Mac【右上角】
- 5. CRTL+S保存为“将备注导出为txt”,PPT中应用。
MAC没自带,需要自己配置
1.搜索自动操作
2.点击快速操作
第一遍可能打不开,可以尝试两次
3.搜索并运行AppleScript
4.输入代码,并选择只应用于Microsoft PowerPoint for Mac【右上角】
on pptGetAllNote(page_from as integer, page_to as integer)set delimit to "--------------------------"tell application "Microsoft PowerPoint"activateset counter to 0set total_text to ""repeat with slideNumber from page_from to page_toset page_text to "(Page " & (slideNumber as text) & ")
"tell slide slideNumber of active presentationtryset page_note to content of text range of text frame of place holder 2 of notes pageon errorset page_note to "(Error)"set counter to counter + 1end tryset page_text to (page_text & page_note & "
" & delimit & "
")set total_text to total_text & page_text & ""end tellend repeatend tellreturn total_text
end pptGetAllNoteon validateInt(str_number as text)tryset N to str_number as integerreturn {0, N}on error number errorNumberreturn {-1, -1}end try
end validateInton validateInput(page_from_to as text, num_slides as integer)set {flag, page_from, page_to} to {-1, -1, -1}set oldDelims to my text item delimiters -- save the current delimitersset my text item delimiters to {"-", "~", "~"} -- the character to split onset num to (count of text items of page_from_to)if num = 1 then# single pageset {flag1, page_from} to my validateInt(first text item of page_from_to)if flag1 = 0 and page_from > 0 and page_from ≤ num_slides then set {flag, page_to} to {0, page_from}else if num = 2 then# multiple pagesset {flag1, page_from} to my validateInt(first text item of page_from_to)set {flag2, page_to} to my validateInt(second text item of page_from_to)if flag1 = 0 and flag2 = 0 and page_from > 0 and page_from ≤ num_slides and page_from ≤ page_to and page_to > 0 and page_to ≤ num_slides then set flag to 0end ifset my text item delimiters to oldDelims -- just to be safe, restore the old delimitersreturn {flag, page_from, page_to}
end validateInputon run {input, parameters}set userLocale to user locale of (system info)tell application "Microsoft PowerPoint" -- version: 2019set ppt_name to name of active presentationset num_slides to count of slides of active presentationset cur_page to slide number of slide of view of active windowif cur_page is missing value thenset tips to ""elseset tips to "[当前页码为 " & cur_page & "]"end ifif num_slides = 1 thenset default_ans to "1"elseset default_ans to "1-" & (num_slides as text)end ifset page_from_to to the text returned of (display dialog "请输入要处理的 PPT 页码范围" & tips & ":" default answer default_ans with title "提取 PPT 文本框内容" with icon note)set {flag, page_from, page_to} to my validateInput(page_from_to, num_slides)repeat while flag ≠ 0set page_from_to to the text returned of (display dialog "请输入要处理的 PPT 页码范围
[请确保页码范围有效]:" default answer default_ans with title "提取 PPT 文本框内容" with icon caution)set {flag, page_from, page_to} to my validateInput(page_from_to, num_slides)end repeatend tellset content_to_write to pptGetAllNote(page_from, page_to)set filename to POSIX path of (((path to desktop folder) as text) & ppt_name & ".txt")(*tell application "TextEdit"activateset newDoc to (make new document with properties {text:(content_to_write as Unicode text)})end tell*)do shell script "cat > " & filename & " << 'EOF'
" & content_to_write as Unicode text & "
'EOF'"set file_path to filename as POSIX filetell application "Finder" to open file file_path
end run
5. CRTL+S保存为“将备注导出为txt”,PPT中应用。
![请添加图片描述](https://i-blog.csdnimg.cn/direct/17d9dfc416df4b09b71a23af28a5e179.png
参考:
https://www.zhihu.com/question/35590265/answer/1193997870