Skip to content

Instantly share code, notes, and snippets.

@sebietter
Last active April 26, 2023 02:05
Show Gist options
  • Save sebietter/4750515 to your computer and use it in GitHub Desktop.
Save sebietter/4750515 to your computer and use it in GitHub Desktop.
AppleScript which uploads images easy using Transmit on OS X.
set dateDay to day of (current date)
set dateMonth to month of (current date)
set dateYear to year of (current date)
set dateTime to time of (current date)
set nameMonth to month of (current date) as string
set currentDate to dateDay & "-" & dateMonth & "-" & dateYear & "-" & dateTime as string
tell application "Finder"
set thisPicture to selection as alias
set the name of thisPicture to "screenshot_mac" & "_" & currentDate & ".png"
set name_chosenPicture to (get the name of thisPicture)
set chosenPicture to (POSIX path of thisPicture) as text
end tell
tell application "Transmit"
activate
set myFave to item 1 of (favorites whose name is "YOUR TRANSMIT FAVORITE")
tell current tab of (make new document at end)
connect to myFave
tell remote browser
set lastPicture to (get the name of the last browser item whose name starts with "screenshot_mac")
if (lastPicture is not name_chosenPicture) then
upload item at path chosenPicture
else if (lastPicture is name_chosenPicture) then
delay 1
end if
set pictureURL to (get the path of the last browser item whose name contains nameMonth)
end tell
end tell
close front window
quit application
end tell
set the clipboard to "YOUR BASE URL" & pictureURL
@aebs90
Copy link

aebs90 commented Apr 26, 2023

Awesome! This is the closest I have found to what I'm looking for.

Do you know if you can save a favorite? I've been trying for hours without any luck. I think there are no methods / classes to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment