【发布时间】:2021-01-01 06:48:18
【问题描述】:
此 PowerPoint 宏(在 Windows 中)将允许在 OBS 中更改场景,方法是获取演示文稿注释中的前四个字符并将它们解析为 OBS 的击键。例如。 OBS1会在OBS中按键Control+1,从而根据热键设置改变场景。
此宏不适用于 Office 365 for Mac,因为该宏似乎无权访问任何应用程序。我想必须重写宏以包含此操作的 AppleScript,还是我错了?
我该怎么做?
原始宏:
Sub OnSlideShowPageChange()
Dim i As Integer
Dim sNotes As String
Dim sKey As String
i = ActivePresentation.SlideShowWindow.View.CurrentShowPosition
s = Left(ActivePresentation.Slides(i).NotesPage.Shapes.Placeholders(2).TextFrame.TextRange.Text, 4)
If Left(s, 3) = "OBS" Then
sKey = "^" & Right(s, 1)
AppActivate ("OBS")
SendKeys (sKey), 1
AppActivate ("PowerPoint")
End If
End Sub
参考资料: 原创思路:https://obsproject.com/forum/resources/powerpoint-macro-for-controlling-obs.1061/ 带有 VB 的 AppleScript:https://docs.microsoft.com/en-us/office/vba/office-mac/applescripttask
【问题讨论】:
标签: vba applescript powerpoint obs