forked from raycast/script-commands
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
245 additions
and
104 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/osascript | ||
|
||
# Dependency: requires defaultbrowser (https://github.com/kerma/defaultbrowser) | ||
# Install via Homebrew: `brew install defaultbrowser` | ||
|
||
# Required parameters: | ||
# @raycast.schemaVersion 1 | ||
# @raycast.title Default to Arc | ||
# @raycast.mode silent | ||
# @raycast.packageName Browser | ||
|
||
# Optional parameters: | ||
# @raycast.icon images/arc.png | ||
|
||
# Documentation: | ||
# @raycast.author Marcos Sánchez-Dehesa | ||
# @raycast.authorURL https://github.com/dehesa | ||
# @raycast.description Set Arc as the default browser. | ||
|
||
set repeatCount to 0 | ||
|
||
tell application "System Events" | ||
try | ||
my changeDefaultBrowser("browser") | ||
repeat until button 2 of window 1 of process "CoreServicesUIAgent" exists | ||
delay 0.01 | ||
set repeatCount to repeatCount + 1 | ||
if repeatCount = 15 then exit repeat | ||
end repeat | ||
try | ||
click button 2 of window 1 of process "CoreServicesUIAgent" | ||
log "Arc is now your default browser" | ||
on error | ||
log "Arc is already your default browser" | ||
end try | ||
on error | ||
log "The \"defaultbrowser\" CLI tool is required: https://github.com/kerma/defaultbrowser 🔥" | ||
end try | ||
end tell | ||
|
||
to changeDefaultBrowser(thebrowser) | ||
do shell script " | ||
if ! command -v defaultbrowser &> /dev/null; then | ||
exit 1 | ||
fi | ||
defaultbrowser " & thebrowser & " | ||
exit 0 | ||
" | ||
end changeDefaultBrowser |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/osascript | ||
|
||
# Dependency: requires defaultbrowser (https://github.com/kerma/defaultbrowser) | ||
# Install via Homebrew: `brew install defaultbrowser` | ||
|
||
# Required parameters: | ||
# @raycast.schemaVersion 1 | ||
# @raycast.title Default to Chrome | ||
# @raycast.mode silent | ||
# @raycast.packageName Browser | ||
|
||
# Optional parameters: | ||
# @raycast.icon images/chrome.png | ||
|
||
# Documentation: | ||
# @raycast.author Marcos Sánchez-Dehesa | ||
# @raycast.authorURL https://github.com/dehesa | ||
# @raycast.description Set Google Chrome as the default browser. | ||
|
||
set repeatCount to 0 | ||
|
||
tell application "System Events" | ||
try | ||
my changeDefaultBrowser("chrome") | ||
repeat until button 2 of window 1 of process "CoreServicesUIAgent" exists | ||
delay 0.01 | ||
set repeatCount to repeatCount + 1 | ||
if repeatCount = 15 then exit repeat | ||
end repeat | ||
try | ||
click button 2 of window 1 of process "CoreServicesUIAgent" | ||
log "Google Chrome is now your default browser" | ||
on error | ||
log "Google Chrome is already your default browser" | ||
end try | ||
on error | ||
log "The \"defaultbrowser\" CLI tool is required: https://github.com/kerma/defaultbrowser 🔥" | ||
end try | ||
end tell | ||
|
||
to changeDefaultBrowser(thebrowser) | ||
do shell script " | ||
if ! command -v defaultbrowser &> /dev/null; then | ||
exit 1 | ||
fi | ||
defaultbrowser " & thebrowser & " | ||
exit 0 | ||
" | ||
end changeDefaultBrowser |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/osascript | ||
|
||
# Dependency: requires defaultbrowser (https://github.com/kerma/defaultbrowser) | ||
# Install via Homebrew: `brew install defaultbrowser` | ||
|
||
# Required parameters: | ||
# @raycast.schemaVersion 1 | ||
# @raycast.title Default to Chromium | ||
# @raycast.mode silent | ||
# @raycast.packageName Browser | ||
|
||
# Optional parameters: | ||
# @raycast.icon images/chrome-icon.png | ||
|
||
# Documentation: | ||
# @raycast.author Marcos Sánchez-Dehesa | ||
# @raycast.authorURL https://github.com/dehesa | ||
# @raycast.description Set Chromium as the default browser. | ||
|
||
set repeatCount to 0 | ||
|
||
tell application "System Events" | ||
try | ||
my changeDefaultBrowser("chromium") | ||
repeat until button 2 of window 1 of process "CoreServicesUIAgent" exists | ||
delay 0.01 | ||
set repeatCount to repeatCount + 1 | ||
if repeatCount = 15 then exit repeat | ||
end repeat | ||
try | ||
click button 2 of window 1 of process "CoreServicesUIAgent" | ||
log "Chromium is now your default browser" | ||
on error | ||
log "Chromium is already your default browser" | ||
end try | ||
on error | ||
log "The \"defaultbrowser\" CLI tool is required: https://github.com/kerma/defaultbrowser 🔥" | ||
end try | ||
end tell | ||
|
||
to changeDefaultBrowser(thebrowser) | ||
do shell script " | ||
if ! command -v defaultbrowser &> /dev/null; then | ||
exit 1 | ||
fi | ||
defaultbrowser " & thebrowser & " | ||
exit 0 | ||
" | ||
end changeDefaultBrowser |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/osascript | ||
|
||
# Dependency: requires defaultbrowser (https://github.com/kerma/defaultbrowser) | ||
# Install via Homebrew: `brew install defaultbrowser` | ||
|
||
# Required parameters: | ||
# @raycast.schemaVersion 1 | ||
# @raycast.title Default to Firefox | ||
# @raycast.mode silent | ||
# @raycast.packageName Browser | ||
|
||
# Optional parameters: | ||
# @raycast.icon images/firefox.png | ||
|
||
# Documentation: | ||
# @raycast.author Marcos Sánchez-Dehesa | ||
# @raycast.authorURL https://github.com/dehesa | ||
# @raycast.description Set Firefox as the default browser. | ||
|
||
set repeatCount to 0 | ||
|
||
tell application "System Events" | ||
try | ||
my changeDefaultBrowser("safari") | ||
repeat until button 2 of window 1 of process "CoreServicesUIAgent" exists | ||
delay 0.01 | ||
set repeatCount to repeatCount + 1 | ||
if repeatCount = 15 then exit repeat | ||
end repeat | ||
try | ||
click button 2 of window 1 of process "CoreServicesUIAgent" | ||
log "Firefox is now your default browser" | ||
on error | ||
log "Firefox is already your default browser" | ||
end try | ||
on error | ||
log "The \"defaultbrowser\" CLI tool is required: https://github.com/kerma/defaultbrowser 🔥" | ||
end try | ||
end tell | ||
|
||
to changeDefaultBrowser(thebrowser) | ||
do shell script " | ||
if ! command -v defaultbrowser &> /dev/null; then | ||
exit 1 | ||
fi | ||
defaultbrowser " & thebrowser & " | ||
exit 0 | ||
" | ||
end changeDefaultBrowser |
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/osascript | ||
|
||
# Dependency: requires defaultbrowser (https://github.com/kerma/defaultbrowser) | ||
# Install via Homebrew: `brew install defaultbrowser` | ||
|
||
# Required parameters: | ||
# @raycast.schemaVersion 1 | ||
# @raycast.title Default to Safari | ||
# @raycast.mode silent | ||
# @raycast.packageName Browser | ||
|
||
# Optional parameters: | ||
# @raycast.icon images/safari.png | ||
|
||
# Documentation: | ||
# @raycast.author Marcos Sánchez-Dehesa | ||
# @raycast.authorURL https://github.com/dehesa | ||
# @raycast.description Set Safari as the default browser. | ||
|
||
set repeatCount to 0 | ||
|
||
tell application "System Events" | ||
try | ||
my changeDefaultBrowser("safari") | ||
repeat until button 2 of window 1 of process "CoreServicesUIAgent" exists | ||
delay 0.01 | ||
set repeatCount to repeatCount + 1 | ||
if repeatCount = 15 then exit repeat | ||
end repeat | ||
try | ||
click button 2 of window 1 of process "CoreServicesUIAgent" | ||
log "Safari is now your default browser" | ||
on error | ||
log "Safari is already your default browser" | ||
end try | ||
on error | ||
log "The \"defaultbrowser\" CLI tool is required: https://github.com/kerma/defaultbrowser 🔥" | ||
end try | ||
end tell | ||
|
||
to changeDefaultBrowser(thebrowser) | ||
do shell script " | ||
if ! command -v defaultbrowser &> /dev/null; then | ||
exit 1 | ||
fi | ||
defaultbrowser " & thebrowser & " | ||
exit 0 | ||
" | ||
end changeDefaultBrowser |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.