Playnite Forums
Dynamic folder paths in scripts tab? - Printable Version

+- Playnite Forums (https://playnite.link/forum)
+-- Forum: Playnite (https://playnite.link/forum/forum-1.html)
+--- Forum: General (https://playnite.link/forum/forum-2.html)
+--- Thread: Dynamic folder paths in scripts tab? (/thread-64.html)



Dynamic folder paths in scripts tab? - steve-o - 12-12-2019

Hi,

So I've lately been ripping a lot of my old CD/DVD games to ISO files and setting them up in Playnite.  Overall this has been going really well, and I'm impressed with how simple (relatively speaking) it is to set this up.  In particular, I'm using the scripts tab (pre- and post-game scripts) to mount and unmount the ISO of the game disc, so it will run without me needing to put the actual CD in my actual drive.

This has thus far involved a lot of copy/paste and editing install directory path names to mount the correct ISO (I put the ISO in the game's install dir so it won't get lost.)  Which got me wondering:

I know there's a few macros, like "{InstallDir}" that can be referenced over on the Actions tab, but putting that in my Script tab commands doesn't seem to work like I had hoped.  Is there a way to create macros like that, so that I could just have one mount command that resolves the game's install dir dynamically?

Right now I'm doing a lot of this, for each game:
Mount-Drive -image "<HARDCODED_INSTALL_PATH>\<HARDCODED_FILENAME.ISO>"

But it would be cool if I could do this:
Mount-Drive -image "{InstallDir}\{ImageName}"

Is there a way to do this that I just haven't found yet?


RE: Dynamic folder paths in scripts tab? - Crow - 12-12-2019

Game variables are currently not being expanded in game scripts. I'll add it in Playnite 7: https://github.com/JosefNemec/Playnite/issues/1589


RE: Dynamic folder paths in scripts tab? - steve-o - 12-13-2019

Sweet!
Every time I think of a feature to request, I find out it either already exists, or it's coming soon. Amazing!


RE: Dynamic folder paths in scripts tab? - Crow - 12-13-2019

I opened that issue based on this thread, it wouldn't be coming without you mentioning it first Smile