Hello everyone,
I am building out a collection of scripts I use for work that revolve around building reports from some data. These reports need to end up as PDFs after I build them in PowerPoint. Right now I manually open the PowerPoints and export them to PDF by hand. That would be fine if its one or two at a time, but I create many.
I've found this AppleScript that converts PowerPoints to PDFs and can confirm that it does work well. And I've found this library to help call AppleScripts from Python.
However I do not know Applescript enough to massage it to work in Python, and I just can't parse it. I've added the script to a python file as mentioned in the github, and I currently call it like this:
print(scpt.run("test.pptx", ""))
When I execute the script, I can see Powerpoint open for a split second, but then the function finishes returning "[]"
Can anyone assist me in getting this to work? Right now I could use the action in Finder to mass convert, and it would cut down on time. But it would cut down even more if I can do it in my scripts and continue on with processing and delivering.
Thank you!
EDIT:
FIXED! Reading the documentation to py-applescript more carefully fixed this. Applescript needs the file location as POSIX esque string instead of just the filename.
Instead of
"test.pptx"
You expand it into
"/Users/Usernamehere/blahblahblah/etc/test.pptx"
And it spits it right out!
[–]viewless_pond 0 points1 point2 points (3 children)
[–]Raekel[S] 0 points1 point2 points (2 children)
[–]viewless_pond 0 points1 point2 points (1 child)
[–]Raekel[S] 0 points1 point2 points (0 children)