Skip to content

Commit d6efbd9

Browse files
authored
Merge pull request #958 from iloveitaly/safari-download-url
download current safari url
2 parents 69fbaf7 + 30675f7 commit d6efbd9

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/osascript
2+
3+
# Required parameters:
4+
# @raycast.schemaVersion 1
5+
# @raycast.title Download Current URL
6+
# @raycast.mode silent
7+
8+
# Optional parameters:
9+
# @raycast.packageName Safari
10+
# @raycast.icon images/safari.png
11+
12+
# @Documentation:
13+
# @raycast.author Michael Bianco
14+
# @raycast.authorURL https://github.com/iloveitaly
15+
# @raycast.description Download the currently active tab's URL.
16+
17+
tell application "Safari"
18+
activate
19+
set currentTab to current tab of window 1
20+
set theURL to URL of currentTab
21+
end tell
22+
23+
-- Simulate pressing Option key and clicking the link
24+
tell application "System Events"
25+
keystroke "l" using {command down} -- Select the address bar (Cmd + L)
26+
delay 0.5
27+
keystroke return using {option down} -- Press Option + Return to download the file
28+
end tell

0 commit comments

Comments
 (0)