Is there a way to post a templated messaged to slack

Hi, I usually post a particular kind of message to Slack application to one of my private channel. I was wondering if there is a way to post message directly to slack based on what I have in the Copy clipboard.

So for e.g. let’s say I have a channel called as ‘Friends’ on Slack and I have a text copied in the clipboard e.g. some URL copied using (command + c)

So is it possible to have a Macro e.g. (command + t) that would directly post a copied message to slack channel.

I tried going to this link and using what has been provided but that does not work:

A plugin is basically just a script. Have a look at the script involved and/or contact the author of the plugin and see if it needs updating - perhaps Slack changed slightly in a way that breaks the script.

I was running into the same issue trying to clip URLs from Safari to Slack (since there is no native Safari extension). I ended up just using curl and a simple AppleScript. You’ll first need to make an incoming WebHook for Slack so you have a URL to direct the content to.

The AppleScript looks something like this:

tell application "Safari"
	set longURL to URL of front document
end tell

set shellScript to ("curl -X POST --data-urlencode 'payload={\"channel\": \"#general\", \"username\": \"Keyboard Maestro Bot\", \"text\": \"" & longURL & "\", \"icon_emoji\": \":ghost:\", \"unfurl_links\": true}' [Your WebHook URL here without brackets]")

do shell script shellScript

You should be able to modify it pretty readily to just act on your clipboard contents if you want.

You can check out how to configure a WebHook and modify how it posts to slack with attachments here:

Hope it helps.