Created
January 22, 2017 09:49
-
-
Save danromero/abaf1e946f68feb575a7ee81d0935a18 to your computer and use it in GitHub Desktop.
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
import os | |
import random | |
x = random.sample(range(1, 100), 3) | |
x = list(map(str, x)) | |
y = ', '.join(x) | |
cmd = """ | |
osascript -e ' | |
set the_list to {%s} | |
choose from list the_list | |
tell application "Keynote" | |
activate | |
set thisDocument to make new document with properties ¬ | |
{height:764, width:1024, document theme:theme "White"} | |
tell thisDocument | |
tell slide 1 | |
set the base slide to master slide "Title - Top" of thisDocument | |
set the object text of the default title item to "Revenue" | |
add chart row names {"ROW A"} column names {"COL A", "COL B", "COL C"} ¬ | |
data {the_list} type vertical_bar_2d group by chart column | |
end tell | |
end tell | |
end tell | |
' | |
""" % y | |
os.system(cmd) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment