Skip to content

Instantly share code, notes, and snippets.

@loxal
Created August 30, 2025 21:36
Show Gist options
  • Save loxal/cae9f0c84717d87dd5b277d09ab3d7fc to your computer and use it in GitHub Desktop.
Save loxal/cae9f0c84717d87dd5b277d09ab3d7fc to your computer and use it in GitHub Desktop.
macOS shortcut for doing an AI query in the Comet browser
-- 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
@loxal
Copy link
Author

loxal commented Aug 30, 2025

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment