From e32bc50191dc6c2daa0d31dc649ef29982078466 Mon Sep 17 00:00:00 2001 From: Alex Gerdes Date: Mon, 30 Jun 2025 14:16:54 +0200 Subject: [PATCH 1/2] New script to open a Safari window with a given profile. --- commands/apps/safari/safari-open-profile.sh | 26 +++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 commands/apps/safari/safari-open-profile.sh diff --git a/commands/apps/safari/safari-open-profile.sh b/commands/apps/safari/safari-open-profile.sh new file mode 100755 index 000000000..4663b4da0 --- /dev/null +++ b/commands/apps/safari/safari-open-profile.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Safari Profile +# @raycast.mode silent + +# Optional parameters: +# @raycast.icon images/safari.png +# @raycast.packageName Safari +# @raycast.argument1 { "type": "text", "placeholder": "profile", "optional": true } + +# Documentation: +# @raycast.description Open Safari with a given profile (default is Personal). +# @raycast.author Alex Gerdes +# @raycast.authorURL http://www.botkes.nl + +osascript < Date: Tue, 8 Jul 2025 23:14:36 +0200 Subject: [PATCH 2/2] Changed the 'safari open profile' from a bash- to an applescript. --- ...ile.sh => safari-open-profile.applescript} | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) rename commands/apps/safari/{safari-open-profile.sh => safari-open-profile.applescript} (50%) diff --git a/commands/apps/safari/safari-open-profile.sh b/commands/apps/safari/safari-open-profile.applescript similarity index 50% rename from commands/apps/safari/safari-open-profile.sh rename to commands/apps/safari/safari-open-profile.applescript index 4663b4da0..2a3df64f1 100755 --- a/commands/apps/safari/safari-open-profile.sh +++ b/commands/apps/safari/safari-open-profile.applescript @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/osascript # Required parameters: # @raycast.schemaVersion 1 @@ -15,12 +15,22 @@ # @raycast.author Alex Gerdes # @raycast.authorURL http://www.botkes.nl -osascript < 0 then + if item 1 of argv is not "" then + set profile to item 1 of argv + end if + end if + + set menuItem to "New " & profile & " Window" + + tell application "System Events" + tell process "Safari" + click menu item menuItem of menu 1 of menu item "New Window" of menu "File" of menu bar 1 + end tell + end tell +end run