Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save danromero/abaf1e946f68feb575a7ee81d0935a18 to your computer and use it in GitHub Desktop.
Save danromero/abaf1e946f68feb575a7ee81d0935a18 to your computer and use it in GitHub Desktop.
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