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