From 92a83779d91de36ec598ffd67c6b9f114a142773 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 10 May 2023 16:17:01 -0400 Subject: [PATCH] Add macos-sendkey --- macos-sendkey | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 macos-sendkey diff --git a/macos-sendkey b/macos-sendkey new file mode 100755 index 0000000..e77818e --- /dev/null +++ b/macos-sendkey @@ -0,0 +1,10 @@ +#!/usr/bin/env ruby + +# I edited the global keyboard shortcuts and turned on Mission Control > Switch +# to Desktop 1 with shortcut set to Control + Alt + Command + Tab + +require "open3" + +script = 'tell application "System Events" to keystroke tab using {option down, command down, control down}' + +stdout, status = Open3.capture2("osascript", stdin_data: script)