Hyper is an elegant Terminal App for macOS (also available on Windows and Linux).
However, it is built based on Node.js using Electron which does not come with AppleScript support like iTerm does.
So I took a detour, utilizing an alternative.
-
It first copys the text you select to the ClipBoard.
-
Then it activates the Hyper App and brings it to front, launching it if it is not open.
-
Considering the lauching speed, delay 1 second (May change for different computers) to wait for the window popping up.
-
Simulate the keypress combo โ+V to perform Paste.
-
Delay for 0.5 seconds (Optional) and simulate keypress Return.
Similar as above, the AppleScript code is altered accordingly.
Install PopClip Extension here and rename the zip file to "Hyper.popclipext".
Install Alfred AppleScript here and put the content text to Alfred Terminal Settings section.