Get URL by Quick Action in Safari

Hello! I apologize for my English in advance.


I create Quick Action (QA) in Automator to get URL of current page from Safari:

"no input" in "any application", check "Output replaces selected text".

Add AppleScript:

on run {input, parameters}
	tell application "Safari" to set myURL to URL of current tab of front window
	return myURL
end run

Save.


If I click Run - I can see URL in Results (obviously Safari must be open in background).

If I ctrl+click on any text field on any web page in Safari and call my QA - I get an error: "AppleEvent timed out".

If I call my QA in TextEdit - URL is inserted fine.


Same if use "Get Current Webpage from Safari" from Library, but get another error: No web pages open in Safari.


Can anyone help? Thanks.

MacBook Pro 13″, macOS 14.5

Posted on Jul 26, 2024 2:11 AM

Reply

Similar questions

1 reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Get URL by Quick Action in Safari

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.