Skip to content

Instantly share code, notes, and snippets.

@rtldg
Created January 6, 2026 14:38
Show Gist options
  • Select an option

  • Save rtldg/c08d703ab81844745c20791a0d0cdf3e to your computer and use it in GitHub Desktop.

Select an option

Save rtldg/c08d703ab81844745c20791a0d0cdf3e to your computer and use it in GitHub Desktop.
PSD text spell-checker that kind of sucks and wasn't practical
function Encode-Url {
param([string]$url)
return [System.Net.WebUtility]::UrlEncode($url)
}
Push-Location -LiteralPath "$PSScriptRoot"
$psd = gc "*.psd" -Raw -Encoding UTF8;
$text_layers = (Select-String -Pattern '<photoshop:LayerText>(.*)</photoshop:LayerText>' -InputObject $psd -AllMatches |
Foreach {$_.matches} |
Foreach {$_.Groups[1].Value} |
Foreach {$_.replace("-", "")} |
Foreach {$_.substring(0,1).toupper() + $_.substring(1).tolower()} |
Out-String);
$url_fragment = (Encode-Url $text_layers);
Start-Process -WorkingDirectory C:\ "https://writewithharper.com/#$url_fragment"
// ==UserScript==
// @name Harper URL Fragment grammar checker
// @namespace http://tampermonkey.net/
// @version 2025-05-22
// @description Harper URL Fragment grammar checker
// @author You
// @match https://writewithharper.com/
// @icon https://icons.duckduckgo.com/ip2/writewithharper.com.ico
// @grant none
// ==/UserScript==
(function() {
'use strict';
function apply_fragment() {
const textarea = document.querySelector("textarea");
if (!textarea) {
setTimeout(apply_fragment, 500);
return;
}
if (window.location.hash.length > 2) {
textarea.value = decodeURIComponent(window.location.hash.substring(1).replaceAll("+", " "));
textarea.dispatchEvent(new Event("input"));
}
}
setTimeout(apply_fragment, 1500);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment