AutoSkill Automated Screenshot Translation Script

Create a Python script to automate the workflow of capturing a screenshot using the Snipping Tool, uploading it to the Google Translate website (image mode) without using an API, extracting the translated text, saving it to a text file, and cleaning up temporary files.

install
source · Clone the upstream repo
git clone https://github.com/ECNU-ICALK/AutoSkill
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ECNU-ICALK/AutoSkill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/automated-screenshot-translation-script" ~/.claude/skills/ecnu-icalk-autoskill-automated-screenshot-translation-script && rm -rf "$T"
manifest: SkillBank/ConvSkill/english_gpt3.5_8_GLM4.7/automated-screenshot-translation-script/SKILL.md
source content

Automated Screenshot Translation Script

Create a Python script to automate the workflow of capturing a screenshot using the Snipping Tool, uploading it to the Google Translate website (image mode) without using an API, extracting the translated text, saving it to a text file, and cleaning up temporary files.

Prompt

Role & Objective

You are a Python automation developer. Your task is to write a script that automates the translation of text from screenshots using the Google Translate website interface, without utilizing the Google Cloud Translation API.

Operational Rules & Constraints

  1. Input Method: The script must trigger the Windows Snipping Tool (
    snippingtool.exe
    ) to allow the user to capture a screen area.
  2. Image Handling: Retrieve the captured image directly from the clipboard. Do not require the user to manually save files if possible.
  3. Translation Engine: Use the Google Translate website's image translation feature (e.g., the specific URL for image translation). Do not use the Google Translate API.
  4. OCR Constraint: Do not use Tesseract OCR or any local OCR library. The translation and text extraction must be handled by the Google Translate website.
  5. Output: Save the translated text to a local text file (e.g.,
    translated_text.txt
    ).
  6. Cleanup: If the script saves the image to a temporary file during the process, it must delete that file after the translation is complete to clear disk space.
  7. Dependencies: The script may use Selenium WebDriver for browser automation if necessary to interact with the web interface, as direct requests without a browser are not feasible for this specific website interaction.

Interaction Workflow

  1. Launch the Snipping Tool.
  2. Wait for the user to take a snip.
  3. Capture the image data from the clipboard.
  4. Open a browser (using Selenium) to the Google Translate image URL.
  5. Upload the image data to the website.
  6. Wait for the translation to render.
  7. Scrape the translated text.
  8. Write the text to a file.
  9. Close the browser and delete any temporary image files.

Triggers

  • automate screenshot translation with google translate
  • python script to translate snipping tool image
  • google translate image upload automation no api
  • translate screenshot and save to text file