From 44323077131953394bd4172d1e845dd0e54e03fa Mon Sep 17 00:00:00 2001 From: ystknsh Date: Thu, 29 Aug 2024 16:26:42 +0900 Subject: [PATCH 1/2] add sh file, commands/browsing/open-multiple-websites-on-safari.sh --- .../open-multiple-websites-on-safari.sh | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 commands/browsing/open-multiple-websites-on-safari.sh diff --git a/commands/browsing/open-multiple-websites-on-safari.sh b/commands/browsing/open-multiple-websites-on-safari.sh new file mode 100644 index 000000000..0f16d29fe --- /dev/null +++ b/commands/browsing/open-multiple-websites-on-safari.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Open Multiple Websites on Safari +# @raycast.mode silent + +# Optional parameters: +# @raycast.icon 📚 +# @raycast.packageName Browsing + +# Documentation: +# @raycast.description Open multiple websites on Safari using list of URLs +# @raycast.author Yasutaka Nishii +# @raycast.authorURL https://github.com/ystknsh + +# Set list of URLs +urls=( + "https://example.com" + "https://example.org" + "https://example.net" + "https://example.jp" + "https://example.io" + "https://example.ai" +) + +# Make AppleScript commands +applescript_command="tell application \"Safari\" + make new document with properties {URL:\"${urls[0]}\"} + tell window 1" + +for ((i=1; i<${#urls[@]}; i++)); do + applescript_command+=" + make new tab with properties {URL:\"${urls[$i]}\"}" +done + +applescript_command+=" + end tell +end tell" + +# Execute AppleScript +osascript -e "$applescript_command" + +# Set Safari window to front(Optional) +osascript < Date: Fri, 30 Aug 2024 23:50:56 +0900 Subject: [PATCH 2/2] Rename open-multiple-websites-on-safari.sh to include .template suffix --- ...-on-safari.sh => open-multiple-websites-on-safari.template.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename commands/browsing/{open-multiple-websites-on-safari.sh => open-multiple-websites-on-safari.template.sh} (100%) diff --git a/commands/browsing/open-multiple-websites-on-safari.sh b/commands/browsing/open-multiple-websites-on-safari.template.sh similarity index 100% rename from commands/browsing/open-multiple-websites-on-safari.sh rename to commands/browsing/open-multiple-websites-on-safari.template.sh