Skip to content

Instantly share code, notes, and snippets.

@KevinGutowski
Created December 5, 2025 22:28
Show Gist options
  • Select an option

  • Save KevinGutowski/204bc0ca72a940e09e46cc5b323e7f37 to your computer and use it in GitHub Desktop.

Select an option

Save KevinGutowski/204bc0ca72a940e09e46cc5b323e7f37 to your computer and use it in GitHub Desktop.
Autolabel screenshots
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