Author Topic: [v1.7.0.4] "Run an Application" combining environment variable with tokens fails  (Read 2382 times)

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
I use NirCmd to take screenshots, triggered by VoiceAttack. After switching to Windows 10(Yes, I have; VR pretty much requires it. I've spent about 4 days after the install stripping all the junk and "telemetry" out though >:() the path to my user folder changed, and generally I've been switching to environment-variable or token-based paths to make my profiles more portable.

However, when attempting to do so with the "Run an Application" action that launches NirCmd, I ran into an issue where NirCmd seemingly wouldn't produce any output.

Running what the log said would be the parameters passed to NirCmd from the commandline works perfectly, so the syntax itself isn't wrong, yet VoiceAttack still doesn't produce a result(I don't know if it's even actually launching the application, though I don't get an error message).

Some testing revealed that a path combining an environment variable with tokens, like this:
Code: [Select]
savescreenshot "%USERPROFILE%\Desktop\{TXT:notset}file.png"Would fail to launch.

Tokens or an environment variable by themselves works fine, however.
E.G.
Code: [Select]
savescreenshot "C:\Users\User\Desktop\{TXT:notset}file.png"or
Code: [Select]
savescreenshot "%USERPROFILE%\Desktop\file.png"run the application and produce output as expected.


If tokens are combined with an environment variable in the path to the application, launching will fail with an "[The system cannot find the file specified]" error.


Running these strings through a "Write a Value to the Event Log" produces perfectly valid output, so it appears to be an issue with the "Run an Application" action.


EDIT: Fixed in v1.7.0.7
« Last Edit: May 23, 2018, 01:33:30 PM by Pfeil »

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832
I think I've got that worked out.  It would either do one or the other for some reason.  Maybe it was an overhead thing (the code is in with token processing).  Instead of changing the global token processing, I just touched it up in the path and the working dir for the launch app UI.  Thanks for letting me know!

Pfeil

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4782
  • RTFM
I just touched it up in the path and the working dir for the launch app UI.
Would it be possible to apply that fix to the "With these parameters" textbox as well?

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2832