-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME_Rename_Single_File.applescript_deepseek-coder_latest_raw.json
More file actions
1 lines (1 loc) · 3.46 KB
/
README_Rename_Single_File.applescript_deepseek-coder_latest_raw.json
File metadata and controls
1 lines (1 loc) · 3.46 KB
1
{"model":"deepseek-coder:latest","created_at":"2025-04-29T22:56:00.896336Z","message":{"role":"assistant","content":"## Overview - What the script does \u0026 its purpose\nThis AppleScript is designed to automate renaming of screenshots using Optical Character Recognition (OCR). The main functionality includes selecting a screenshot file by user prompting them for selection; capturing and extracts title region from image with Tesseract OCR engine, cleans the extracted text \u0026 optionally renames it.\n \n## Requirements - Dependencies and prerequisites \n1. Mac OS X: This script is tested on a MacBook Pro running macOS High Sierra version 10.13.6 with AppleScript installed as Version '2'.\n \n2. Tesseract Engine (Optional): If you intend to use OCR, install the tesseract engine which can be downloaded from https://github.com/tesseract-ocr/tesseract/. The script is designed for MacOS and supports english language only using 'eng' option in Tesseract Engine.\n \n## Usage - How to use this the script with examples \n1. Open AppleScript Editor on your MacBook Pro: Press `Command+Shift+E` or open \"Screen Recorder\" from System Preferences \u003e Music \u0026 Media and select Screen Sharing tab, then click Edit Scripts button in lower left corner of main window which appears as a list of all the scripts running currently available to you.\n \n2. Paste your script into AppleScript Editor: Once opened it would look like following (I've provided only relevant part for readability): \n```applescript \nset selectedFile to choose file with prompt \"Select a screenshot to rename\" of type {\"png\"} -- Let the user select a file set titleRegionCoordinates to \"-R 100,200,600,100\"-- Update these! \t \t\t \t\t\t \nset titleRegionFile to \"/tmp/title_region.png-- Capture the title region (adjust coordinates for your slide!) do shell script \"screencapture\" \u0026 space \"\"quoted form of selectedFile\"\"space \"\"\"\u0026 quoted form of POSIX path of selectedFile\"\"\" \u0026 quot;\"/home/\"user login name\".screen capture/titleRegion.png \n\tdo shell script \"/usr/local/bin//tesseract --stdout -l eng \"2\u003e /dev/null | tr \"\\-\\-\" '\\n'\"\"\u0026quot;\" title region file\" do shell script \"\"echo \u0026 quot; rawTitle ,,,,,\" after triming white space\n\tdo shell script \"\"\"titleRegionFile=(clean Title )? set cleanTittle to “Untitled_Slide”.png (new path of the originalPath)/\"_\u0026quot;\"Clean Tittle)\u0026\".png\" do shell script \"mv \u0026 quot;original Path quoted form selected file\"/ newpath\ndisplay notification \"\"Success!\"\" with title \"\"\"File renamed\"\"\" using message body (\"You have successfully rename screenshot as “\")+cleanTititle.”) \t \t\t \t\t\t \n``` \t\t\t\t \t \t\t\t\t\t \t \t \t -R---,208,-736,,415-Mobilenetvocabulars/Homebrew (user login name).screen capture / tmp “titleRegion.png” tesseract --stdout \"eng\" do shell script \"-l eng\"\"..tesseract - std out-\"\n!, 2\u003e \"/dev/null | tr \"\\-\\- \"\"\\n',\" \u0026 quoted form of selectedFile), space \"\"\"\u0026quot;homebrew / bin/\"user login name\".screen capture tessearct.app\" do shell script \"mv\"\" original path\"/new Path”do ShellScript “screencapture - R102,349 ,687,,5\n"},"done_reason":"stop","done":true,"total_duration":11850008250,"load_duration":1063242500,"prompt_eval_count":675,"prompt_eval_duration":634507917,"eval_count":830,"eval_duration":10146008417}