Created
December 5, 2025 22:28
-
-
Save KevinGutowski/204bc0ca72a940e09e46cc5b323e7f37 to your computer and use it in GitHub Desktop.
Autolabel screenshots
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on run {input, parameters} | |
| tell application "System Events" | |
| set frontApp to name of first application process whose frontmost is true | |
| end tell | |
| if frontApp is not "Google Chrome" and frontApp is not "Safari" then | |
| return input | |
| end if | |
| set theURL to "" | |
| if frontApp is "Google Chrome" then | |
| tell application "Google Chrome" | |
| if (count of windows) > 0 then | |
| set theURL to URL of active tab of front window | |
| end if | |
| end tell | |
| else if frontApp is "Safari" then | |
| tell application "Safari" | |
| if (count of windows) > 0 then | |
| set theURL to URL of front document | |
| end if | |
| end tell | |
| end if | |
| if theURL is "" then return input | |
| repeat with f in input | |
| try | |
| set pAlias to (POSIX file (POSIX path of f)) as alias | |
| tell application "Finder" | |
| set comment of pAlias to theURL | |
| end tell | |
| end try | |
| end repeat | |
| return input | |
| end run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment