Hi !
First time posting here
Description
At work, we have application that send email notification. When working remotely, the URLs in those mail do not work because of network-proxy-shenanigan.
I'm trying to set a macro that transform the clicked links so the app can be accessed. It works fine with Chrome but don't with Safari.
The problems is that %FrontBrowserURL%
returns safari-resource:/ErrorPage.html
when hitting a 404 instead of the actual URL.
I tried to get the URL via Apple Script but it returns the same value
tell application "Safari"
return URL of front document as string
end tell
and Javascript where I get nothing
function run(input, parameters) {
var app = Application("Safari");
app.includeStandardAdditions = true;
var url = app.doJavaScript('window.getSelection().anchorNode.parentNode.href',{
in: app.windows[0].currentTab
});
return url;
}
Ask
Did someone know how to get the actual URL in Safari even if accessing an inaccessible page (404, etc) ?
Additional info
Here's is my macro
Convert links.kmmacros (9.6 KB)