Skip to content

Instantly share code, notes, and snippets.

@dnnsmnstrr
Created March 24, 2025 11:45
Show Gist options
  • Save dnnsmnstrr/a3308b9f5eed8354ca3d0430d57f4f6d to your computer and use it in GitHub Desktop.
Save dnnsmnstrr/a3308b9f5eed8354ca3d0430d57f4f6d to your computer and use it in GitHub Desktop.
Raycast Script Command to quickly open URLs in Responsively (https://responsively.app/)
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Open URL in Responsively
# @raycast.mode silent
# Optional parameters:
# @raycast.icon /Applications/ResponsivelyApp.app/Contents/Resources/icon.icns
# Documentation:
# @raycast.author dnnsmnstrr
# @raycast.authorURL https://raycast.com/dnnsmnstrr
# @raycast.description Opens copied URL in Responsively (https://responsively.app/) - falls back to the currently active webpage in Google Chrome
# Function to check if a string is a valid URL
is_valid_url() {
[[ $1 =~ ^https?:// ]]
}
# Get the URL from the clipboard
url=$(pbpaste)
# Check if the clipboard text is a valid URL
if is_valid_url "$url"; then
open "responsively://$url"
else
# Use AppleScript to get the URL of the foremost Chrome tab
url=$(osascript -e 'tell application "Google Chrome" to get URL of active tab of front window')
# If a URL is found, open it in Responsively
if [[ -n "$url" ]]; then
open "responsively://$url"
else
echo "No URL found in clipboard or open Chrome tabs."
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment