by TIV73 » Tue Aug 17, 2021 5:03 pm
What is happening in that snippet is that you are opening the navigationHandler of type explorerFolder. A navigation handler is just that, a handler for a certain type of navigation, e.g. opening a certain album, or a playlist or something. The explorerFolder handler opens the file explorer at whatever path you point it to.
You can't just give it a folder name, it expects a track object, that's why the lines above the handler do. The snippet just creates an empty dummy track object, suppresses some notifications, sets the filepath of the dummy track to whatever has been provided in the initPath parameter and passes the object to the explorerFolder handler, which then opens an explorer window at the file path. Issue is that explorerFolder does just this one thing. You can't tell it to open a file or start an application.
What you likely want is
utils.shellExecute which accepts two arguments for the command to execute and additional parameters:
Code: Select all
app.utils.shellExecute('explorer','C:\\temp')
What is happening in that snippet is that you are opening the navigationHandler of type explorerFolder. A navigation handler is just that, a handler for a certain type of navigation, e.g. opening a certain album, or a playlist or something. The explorerFolder handler opens the file explorer at whatever path you point it to.
You can't just give it a folder name, it expects a track object, that's why the lines above the handler do. The snippet just creates an empty dummy track object, suppresses some notifications, sets the filepath of the dummy track to whatever has been provided in the initPath parameter and passes the object to the explorerFolder handler, which then opens an explorer window at the file path. Issue is that explorerFolder does just this one thing. You can't tell it to open a file or start an application.
What you likely want is [i]utils.shellExecute[/i] which accepts two arguments for the command to execute and additional parameters:
[code]app.utils.shellExecute('explorer','C:\\temp')[/code]