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?
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.