Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jedi4ever/python-keynote
https://github.com/jedi4ever/python-keynote
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/jedi4ever/python-keynote
- Owner: jedi4ever
- Created: 2024-07-27T15:24:48.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-27T20:34:38.000Z (5 months ago)
- Last Synced: 2024-07-28T17:13:08.918Z (5 months ago)
- Language: Python
- Size: 353 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Python Keynote Library
## Description
> This is still Work in ProgressThis package is able to read and write keynote files.
- We use appscript to execute applescript commands
- We are limited to the applescript commands that are exposed to applescript
- To go even further we use applescript UI automation to do moreRemarks:
- This will only work on MacOS as it needs applecript
- It can't be headless and needs a running UI/Login session
- It needs to have Keynote installed
- Needs a working installed Xcode environment## TODO
- see if we can the original files (audio, movies, images):
- using [`keynote-parse`](https://pypi.org/project/keynote-parser/)
- or
- set background of slide, text item
- create text items as bulletlists
- create shapes (rectangle, circle etc)## Notes
### Applescript & Python Strategies
- We first tried to use pyobjc with scriptengine , but found no way to pass a file to create files or export a file
-
-
-
- It was certainly trial and error to get the right properties and syntax- The iWorkAutomation site is very usefull to find those
-
- The one property that was different then expected was that there are no masters properties as described- Appscript can be found at :
- We know appscript is deprecated , but hey it works and we can pass a file
- We use an app called `ASTranslate` to translate applescript scripts to appscript python code
-
- beware that the indexed in applescript start from 1 , in appscript from 0- A related library `keynote-js` can be found for the Javascript ecosystem:
-
-### Applescript & GUI Automation
- Some things are not possible with plain scripting keynote and we have to resort to UI Automation
- Initially we tried using Accessibility inspector but we found executing `UI Elements` in applescript made it easier to find them### Applescript Permissions
- To be able to automate other processes we need Automation permission on MacOS.
- Unfortuneatly we can't set this and it has to be asked on first execution of the app
- If we got `user permission denied`, it won't ask again. Some say reinstalling the app will ask it again- Privacy & Security > Full Disk Access
- Privacy & Security > Files & Folders
- Privacy & Security > Automation
- Privacy & Security > Accessibility # No difference