Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions contrib/Gemini.popclipext/Config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Gemini",
"identifier": "com.gravitypoet.popclip.extension.gemini",
"description": "Open Gemini and copy your selected text plus custom question for quick paste.",
"icon": "gemini.png",
"title": "\u200B",
"popclipVersion": 4586,
"app": {
"name": "Google Gemini",
"link": "https://gemini.google.com/"
},
"requirements": [
"text"
],
"applescriptFile": "gemini.applescript"
}
41 changes: 41 additions & 0 deletions contrib/Gemini.popclipext/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Gemini

Open Gemini in Chrome and prepare a structured prompt from selected text.

## What it does

1. Prompts for your question after you select text.
2. Builds this prompt format:

```text
【原文】
<selected text>

【问题】
<your question>
```

3. Copies the full prompt to your clipboard.
4. Opens a new `https://gemini.google.com/app` tab in Chrome.
5. You paste with `Command+V` and press Enter.

## Why manual paste

Gemini web currently has inconsistent auto-submit behavior across accounts and browser automation settings. This extension uses a stable clipboard-first flow.

## Requirements

- Google Chrome installed
- Logged in to Gemini web

## Author

- GravityPoet

## Credits

- Gemini icon image from Google Gemini web assets (`gstatic.com`), trademark belongs to Google.

## Changelog

- 2026-02-18 First release
32 changes: 32 additions & 0 deletions contrib/Gemini.popclipext/gemini.applescript
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
on run
set selectedText to "{popclip text}"
if selectedText is "" then error "No selected text found." number 700

set dialogResult to display dialog "请输入你想补充问 Gemini 的问题:" default answer "" buttons {"取消", "发送"} default button "发送" cancel button "取消"
set userQuestion to text returned of dialogResult
set trimmedQuestion to my trimText(userQuestion)
if trimmedQuestion is "" then error "问题不能为空。" number 701

set finalPrompt to "【原文】" & return & selectedText & return & return & "【问题】" & return & userQuestion
set the clipboard to finalPrompt

tell application "Google Chrome"
activate
if (count of windows) is 0 then make new window
tell front window
make new tab at end of tabs with properties {URL:"https://gemini.google.com/app"}
set active tab index to (count of tabs)
end tell
end tell

display notification "内容已复制到剪贴板,请在 Gemini 输入框按 Command+V 后回车。" with title "Gemini Ask"
end run

on trimText(rawText)
set text item delimiters to {space, tab, return, linefeed}
set parts to text items of rawText
set text item delimiters to ""
set cleaned to parts as text
set text item delimiters to ""
return cleaned
end trimText
Binary file added contrib/Gemini.popclipext/gemini.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.