当前位置: 首页 > news >正文

【Microsoft® PowerPoint for Mac】MAC一键导出PPT备注

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"
      activate
      set counter to 0
      set total_text to ""
      repeat with slideNumber from page_from to page_to
         set page_text to "(Page " & (slideNumber as text) & ")
"
         tell slide slideNumber of active presentation
            try
               set page_note to content of text range of text frame of place holder 2 of notes page
            on error
               set page_note to "(Error)"
               set counter to counter + 1
            end try
            set page_text to (page_text & page_note & "
" & delimit & "
")
            set total_text to total_text & page_text & "
   
   
"
         end tell
      end repeat
   end tell
   return total_text
end pptGetAllNote

on validateInt(str_number as text)
   try
      set N to str_number as integer
      return {0, N}
   on error number errorNumber
      return {-1, -1}
   end try
end validateInt

on 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 delimiters
   set my text item delimiters to {"-", "~", "~"} -- the character to split on
   set num to (count of text items of page_from_to)
   if num = 1 then
      # single page
      set {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 pages
      set {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 0
   end if
   set my text item delimiters to oldDelims -- just to be safe, restore the old delimiters
   return {flag, page_from, page_to}
end validateInput

on run {input, parameters}
   set userLocale to user locale of (system info)
   
   tell application "Microsoft PowerPoint" -- version: 2019
      set ppt_name to name of active presentation
      set num_slides to count of slides of active presentation
      set cur_page to slide number of slide of view of active window
      if cur_page is missing value then
         set tips to ""
      else
         set tips to "
   [当前页码为 " & cur_page & "]"
      end if
      if num_slides = 1 then
         set default_ans to "1"
      else
         set default_ans to "1-" & (num_slides as text)
      end if
      set 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 ≠ 0
         set 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 repeat
   end tell
   
   set 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"
      activate
      set 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 file
   tell 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

相关文章:

  • 能不能用Ai来开发出一款APP?很早就想过能不能用Ai来开发出一款APP?
  • 89.迷人子序列计数问题|Marscode AI刷题
  • vue2中,打包报错ERROR in /node_modlules/@types/lodash/common/common.d.ts 26
  • python全栈-并发和网络通信
  • GO 快速升级Go版本
  • 【Qt之QQuickWidget】QML嵌入QWidget中
  • c++day4
  • 【嵌入式Linux应用开发基础】网络编程(1):TCP/IP协议栈
  • WIN10 本地部署 BGE Embedding 向量化模型
  • unxi-进程间通信
  • 使用PHP接入纯真IP库:实现IP地址地理位置查询
  • akka现有的分布式定时任务框架总结
  • 条件渲染
  • .Net 9下使用Tensorflow.net---DNN_Keras
  • AI时代前端开发技能变革与ScriptEcho:拥抱AI,提升效率
  • MongoDB 复制(副本集)
  • Uncaught TypeError: Module._malloc is not a function
  • 【学习笔记16】Java中常见的Exception(异常)
  • ROS2 同一个pkg里定义自定义action、msg报错
  • 爬虫解析库:Beautiful Soup的详细使用
  • 资深娱乐策划人、导演马勇逝世,终年51岁
  • 国家发改委:正在会同有关方面,加快构建统一规范、协同共享、科学高效的信用修复制度
  • 澎湃读报丨多家央媒刊文关注拧紧纪律的螺丝:强化监督推动过紧日子要求落到实处
  • 吴双评《发展法学》|穷国致富的钥匙:制度,还是产业活动?
  • 外媒:哈马斯一名高级指挥官尸体被发现,系辛瓦尔弟弟
  • 美国务卿与以色列总理通话,讨论加沙局势