Tuesday, December 10, 2019

#1 2019-11-28 08:11:29 am

scrutinizer82
Member
Registered: 2015-08-04
Posts: 22

Get current web page - no result returned

Hello,

I can't seem to succeed getting the URL of a current Safari page. I want to build a shortcut that would open the page open on iPhone on the Mac by executing SSH script. No matter how I set 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 that in Automator or in AppleScript?

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

Last edited by scrutinizer82 (2019-11-28 08:13:50 am)


Currently running Mac OS X 10.7.5, OS X 10.9.5, macOS 10.13.6

Interests: AppleScript, Automator, Unix

Offline

 

#2 2019-11-29 08:03:46 pm

danaeugene
Member
Registered: 2017-04-02
Posts: 17

Re: Get current web page - no result returned

This works on my system.  Mac OS 10.13.3

Applescript:

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

tell application "Safari"
   URL of document 1
end tell

Offline

 

#3 2019-11-29 10:57:09 pm

scrutinizer82
Member
Registered: 2015-08-04
Posts: 22

Re: Get current web page - no result returned

This forum section is about Siri Shortcuts.


Currently running Mac OS X 10.7.5, OS X 10.9.5, macOS 10.13.6

Interests: AppleScript, Automator, Unix

Offline

 

#4 2019-11-30 10:45:53 am

danaeugene
Member
Registered: 2017-04-02
Posts: 17

Re: Get current web page - no result returned

scrutinizer82,

If

This forum section is about Siri Shortcuts.

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

Is there a way to get the URL of a current page like that in Automator or in AppleScript?

I guess you were asking

Is there a way to get the URL of a current page like that in Automator or in AppleScript using Siri Shortcuts?

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.

Dana

Offline

 

#5 2019-11-30 09:14:32 pm

CK
Member
From:: UK
Registered: 2018-11-04
Posts: 109

Re: Get current web page - no result returned

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

scrutinizer82 wrote:

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

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)