Created
March 24, 2025 11:45
-
-
Save dnnsmnstrr/a3308b9f5eed8354ca3d0430d57f4f6d to your computer and use it in GitHub Desktop.
Raycast Script Command to quickly open URLs in Responsively (https://responsively.app/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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