Automation Export Javascript

Hi, I’d like to automate the following through command line / a plugin:

  1. Select all items in canvas
  2. Select: “Copy As” > “Javascript”

Can someone please direct me on the best way to start?

Greatly appreciate any help!

I would probably use Keyboard Maestro to automate ⌘A followed by a menu choice.

1 Like

I’m not a shell scripter, so I’d use Automator’s “Watch me do” feature to hack the GUI.

https://duckduckgo.com/?q=automator+mac+watch+me+do

The downside is that if the OG UI changes, you’ll have to re-record your Watch Me Do actions. But you’ll still save a few keystrokes in the mean time.

Oh, and for “Select All,” you can use a short Apple Script keystroke command:

tell application "[app name goes here]"
        activate
end tell
tell application "System Events"
		keystroke "a" using {command down} -- select all command
end tell

This can all be done in Automator (including the “Watch Me Do” part), so you can save it as an app and run it from the Dock if you want.