An AppleScript to save a post selected in MarsEdit to a file in the Downloads folder. Use at your own risk. Let me know if you improve on it. 😁

-- very rough starter; use at your own risk
-- 04 October 2024
-- takes details from a post selected in MarsEdit and saves the post to a file in the Downloads folder

tell application “MarsEdit” set newLink to "" set newTitle to "" set myPost to "" set myDate to ""

set newLink to (permalink of selected post) as text
set myDate to (published date of selected post)

set newTitle to (title of selected post) as text
set myPost to (body of selected post) as text

set the clipboard to newLink & return & newTitle & return & myPost & return & "Published on: " & myDate

end tell

– thanks to Claude.io for the file saving portion below

set fileName to newTitle & “.txt” – Change this to your desired file name

tell application “Finder” set downloadsFolder to (path to downloads folder) as text set filePath to downloadsFolder & fileName end tell

try set clipboardContent to the clipboard

set fileRef to open for access file filePath with write permission
write clipboardContent to fileRef
close access fileRef

display dialog "Clipboard content saved to " & fileName & " in Downloads folder." buttons {"OK"} default button "OK"

on error errMsg display dialog “Error: " & errMsg buttons {“OK”} default button “OK” with icon stop end try