Is there a possibility to read RunScript parameters via Favourites.GetFavourites - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174) +---- Thread: Is there a possibility to read RunScript parameters via Favourites.GetFavourites (/showthread.php?tid=379201) |
Is there a possibility to read RunScript parameters via Favourites.GetFavourites - Buschel - 2024-10-19 If I add a script with parameter to Kodi's favorites, is there a way to read the parameters via JSON API, ideally via Favourites.GetFavourites? Examples: Code: <favourite name="Test script" >RunScript("service.autostop","sleep=60")</favourite> Code: <favourite name="Test script" >RunScript("service.autostop","sleep","60")</favourite> I am only aware of the ability to read the path to the script, but not the parameters. RE: Is there a possibility to read RunScript parameters via Favourites.GetFavourites - izprtxqkft - 2024-10-20 (2024-10-19, 19:07)Buschel Wrote: If I add a script with parameter to Kodi's favorites, is there a way to read the parameters via JSON API, ideally via Favourites.GetFavourites? (2024-10-19, 19:07)Buschel Wrote: I am only aware of the ability to read the path to the script, but not the parameters. isn't the path the entire portion inside the bracket so then you just need to parse it? Code: <favourite name="Test script">PATH</favourite> RE: Is there a possibility to read RunScript parameters via Favourites.GetFavourites - Buschel - 2024-10-20 (2024-10-20, 20:36)izprtxqkft Wrote: isn't the path the entire portion inside the bracket so then you just need to parse it? No. For the example Code: <favourite name="Test script" >RunScript("service.autostop","sleep=60")</favourite> RE: Is there a possibility to read RunScript parameters via Favourites.GetFavourites - scott967 - 2024-10-21 Looking at favourites.cpp in the code I don't see that favourites pass anything but the addon id for RunScript or RunAddon. Maybe the assumption is that it would be a plugin? Did you try running this from the favourites window in Kodi? Does it work there (turn on debug and you will log the args passed to python)? scott s. . RE: Is there a possibility to read RunScript parameters via Favourites.GetFavourites - jbinkley60 - 2024-10-21 (2024-10-19, 19:07)Buschel Wrote: If I add a script with parameter to Kodi's favorites, is there a way to read the parameters via JSON API, ideally via Favourites.GetFavourites? Just an FYI, I author the service.autostop addon and it currently doesn't accept any parameters. You simply just call he addon and it just increments through the various sleep timer values. It won't accept a direct value insertion. Thanks, Jeff RE: Is there a possibility to read RunScript parameters via Favourites.GetFavourites - Buschel - 2024-10-21 Thanks for the hint. I just took this from a discussions we had on GitHub a while ago (#865), and use this simply for figuring out how to read script parameters for Favourites via JSON API. Let me also give this a bit more context. An iOS App user raised a use case where scripts with parameters are added to Favourites. And it is possible to call those from Kodi UI, but the remote fails to call the parameters. See this thread. To be able to support this I would need to read these script parameters and add them when issuing the JSON command to execute the script on the Kodi system. From the JSON API I see no obvious way to obtain such parameters. I just wanted to ask, if there are ways I did miss. Preferred would be to add a new return parameter to Favourite.Details.Favourite. RE: Is there a possibility to read RunScript parameters via Favourites.GetFavourites - jbinkley60 - 2024-10-21 (2024-10-21, 06:41)Buschel Wrote: Thanks for the hint. I just took this from a discussions we had on GitHub a while ago (#865), and use this simply for figuring out how to read script parameters for Favourites via JSON API. Ahh thanks. I had forgotten about the conversation because it was within GitHub area for your application. Thanks, Jeff |