How to launch a Spotlight deeplink from JXA?
-
26-05-2021 - |
Question
Red Hot Timer uses the Spotlight search bar to create new timers. From AppleScript I can run
open location "timer://30m"
to start the timer. I have tried
app = Application.currentApplication();
app.includeStandardAdditions = true;
function openLocation() {"timer://30m"}
openLocation()
Solution
To run a Spotlight command use openLocation.
app = Application.currentApplication();
app.includeStandardAdditions = true;
app.openLocation("timer://30m")
Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange