Get current web page - no result returned


I can’t seem to succeed getting the URL of a current Safari page. I want to build a shortcut that would send the page that’s open on iPhone to the Mac by executing SSH script in the “Run SSH script” action in Shortcuts for iOS. No matter how I set the shortcut’s global input (“Accepts Safari pages”, “Accepts URL”) or locally through the usage of variables (as “Url”, as “Text”) or with the action “Get Details of Safari page” (with its output set to “Page URL”), no output is produced.

Is there a way to get the URL of a current page like it’s possible in Automator or with AppleScript?

Model: MacBook Pro
AppleScript: 2.3.2
Browser: Safari 9537.86.7
Operating System: macOS 10.9

This works on my system. Mac OS 10.13.3

use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions

tell application "Safari"
	URL of document 1
end tell

This forum section is about Siri Shortcuts.



is directed at me I apologize. I must not have understood the scope of your question

I guess you were asking

I saw that your post had gone unanswered for quite a while and thought the reply I provided might help you proceed with your project. Sorry for the misunderstanding. Good luck with your shortcut.


I suspect this didn’t help make the nature of the question any less ambiguous:

No, I couldn’t then and I can’t now. The initial post was related to Shortcuts on iOS, the fact that I made clear from the get-go. Shortcuts for macOS was first introduced in macOS Monterrey that is behind the compatibility wall for my computer.

1 Like

I found a solution to my OP the same day.