You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want create a workflow to search the text i input in dialog, since the url parameter for key words to search in google(if the keyword is "中国") is "https://www.google.com/search?q=中国"
so i run this function in lua:
I won't be able to spend time investigating this until next week at the earliest, so here are my initial notes in case someone wants to take a look at it sooner:
NSURL *url = [NSURLURLWithString:[skin toNSObjectAtIndex:1]];
if (url) {
result = [[NSWorkspacesharedWorkspace] openURLs:[NSArrayarrayWithObject:url]
withAppBundleIdentifier:[NSStringstringWithUTF8String:lua_tostring(L, 2)]
options:NSWorkspaceLaunchDefaultadditionalEventParamDescriptor:nillaunchIdentifiers:nil];
}
I don't know yet if NSURL is having issues with the characters being unencoded (though the HTTP spec doesn't require them to be since they are valid UTF-8 and don't match any of the special codes for GET URLs) or with NSWorkspace's openURLs:withAppBundleIdentifier:options:additionalEventParamDescriptor:launchIdentifiers:. It should be noted that this method for NSWorkspace is deprecated in 10.15, but since Hammerspoon tries to support at least the latest three versions of macOS, even if the best solution involves using the newer NSWorkspace methods, code should be implemented to do so in a way that falls back (and ideally also fixes this for that implementation) for earlier macOS versions.
I want create a workflow to search the text i input in dialog, since the url parameter for key words to search in google(if the keyword is "中国") is "https://www.google.com/search?q=中国"
so i run this function in lua:
it works fine if i insert English,but no lucky with Chinese.
now i come up with a alternative solution :
this works fine in both English and Chinese
The text was updated successfully, but these errors were encountered: