I have a macro to open the selected urls. But when the url is a path of a local file, e.g. file:///Users/xxx/Desktop/xxx.pdf, the "open url" action somehow fails. But a simple copy-paste-return does work in chrome. So what's the solution in this case?
Thanks for your reply. This doesn't work either. I think there might be some problems with chrome accessing local files. Though entering the address of local file in the address bar does work.
Chrome doesn't seem to open on my Mac either. Maybe a pdf reader extension is needed?
It works with Firefox and Safari.
But I initially meant to suggest you use other PDF reader apps, such as Preview or other third party apps. I never use web browser for reading local pdf files.
It's unlikely the Open URL action has any bugs in it, since the Open URL action is trivial, it just hands the URL to the system to open, there just isn't a lot of scope for bugs to hide. At its heart, it is just a single line of code.
good = [[NSWorkspace sharedWorkspace] openURLs:@[url] withAppBundleIdentifier:bundleid options:options additionalEventParamDescriptor:nil launchIdentifiers:nullptr];
In any event, I tried opening a pdf with a space in it in Chrome, then copying the URL from the address bar and opening it with the Keyboard Maestro Open URL action, and it opened in Chrome fine for me.
So I would guess there is something else going on. Maybe there is an issue with which Chrome application is selected in the action, or an issue with the URL or an issue with permissions.
Note that the New Google Window/Tab use a completely different mechanism. The latter uses AppleScript to talk directly to Chrome. The former uses NSWorkspace.