Created
August 30, 2025 21:36
-
-
Save loxal/cae9f0c84717d87dd5b277d09ab3d7fc to your computer and use it in GitHub Desktop.
macOS shortcut for doing an AI query in the Comet browser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- The macOS Shortcut should contain two items: | |
| -- 1) "Ask for `Text` with `Prompt`" followed by | |
| -- 2) "Run AppleScript with `Ask for Input`" | |
| on run {input, parameters} | |
| -- Get the first (text) item from Shortcuts input | |
| set userText to "Show me the time!" | |
| try | |
| if class of input is list then | |
| if (count of input) > 0 then set userText to (item 1 of input) as text | |
| else | |
| set userText to input as text | |
| end if | |
| end try | |
| tell application "Comet" | |
| activate | |
| end tell | |
| tell application "System Events" | |
| keystroke "t" using {command down} -- New Tab | |
| keystroke "l" using {command down} -- focus address bar | |
| -- keystroke "Who are you?" | |
| keystroke userText | |
| keystroke return using {shift down} -- Shift-Return | |
| end tell | |
| return input | |
| end run |
Author
loxal
commented
Aug 30, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment