Skip to content

Instantly share code, notes, and snippets.

@jorgemartins
Last active September 25, 2020 06:06
Show Gist options
  • Save jorgemartins/8845faa3215b715276ee9833f2547622 to your computer and use it in GitHub Desktop.
Save jorgemartins/8845faa3215b715276ee9833f2547622 to your computer and use it in GitHub Desktop.
tell application "System Events"
tell process "Framer X"
set frontmost to true
# change to your prototype name.
click menu item "prototype.framerfx" of menu "Window" of menu bar 1
delay 0.1
click menu item "Layers" of menu of menu item "Panel" of menu "View" of menu bar 1
delay 0.2
click at {118, 118}
delay 0.2
click menu item "Export Web Preview…" of menu "File" of menu bar 1
delay 2
key code 36
delay 0.2
key code 49
end tell
end tell
delay 3
#change to Terminal if you dont use iTerm
tell application "iTerm"
activate
end tell
#this assumes you have `now` isntalled globaly
tell application "System Events"
tell process "iTerm"
keystroke "cd /Users/username/prototypeFolder && mkdir .now && cd .now && echo -e '{\"projectId\":\"NOWSPROJECTID\",\"orgId\":\"NOWSORGID\"}' > project.json && cd .."
key code 36
delay 0.2
keystroke "now --prod"
key code 36
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment