Last active
June 3, 2026 14:14
-
-
Save Faibbus/e7077abc22bf129b513145871a5608bc to your computer and use it in GitHub Desktop.
Read-only context.sync in a loop (setInterval)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Read-only context.sync in a loop | |
| description: '' | |
| host: POWERPOINT | |
| api_set: {} | |
| script: | |
| content: > | |
| Office.onReady(() => | |
| document.getElementById("run").addEventListener("click", async () => { | |
| console.log("launch one loop"); | |
| setInterval(async () => await PowerPoint.run(async (context) => { | |
| const selectedSlides = context.presentation.getSelectedSlides(); | |
| const count = selectedSlides.getCount(); | |
| await context.sync(); | |
| console.log(count.value); | |
| }), 500); | |
| }) | |
| ); | |
| language: typescript | |
| template: | |
| content: <button id="run">Run</button> | |
| language: html | |
| style: | |
| content: '' | |
| language: css | |
| libraries: '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment