Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
-- stolen from: https://gist.github.com/gabeanzelini/1931128eb233b0da8f51a8d165b418fa
if (count of theSelectionFromBrave()) is greater than 0 then
set str to "tags: #link
" & theTitleFromBrave() & "
> " & theSelectionFromBrave() & "
[" & theTitleFromBrave() & "](" & theCurrentUrlInBrave() & ")"
tell application "Drafts"
make new draft with properties {content:str, tags: {"link"}}
end tell
end if
on theCurrentUrlInBrave()
tell application "Brave Browser" to get the URL of the active tab in the first window
end theCurrentUrlInBrave
on theSelectionFromBrave()
tell application "Brave Browser" to execute front window's active tab javascript "getSelection().toString();"
end theSelectionFromBrave
on theTitleFromBrave()
tell application "Brave Browser" to get the title of the active tab in the first window
end theTitleFromBrave
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment