Author Topic: Execute command each time profile is unloaded  (Read 4917 times)

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Execute command each time profile is unloaded
« on: February 14, 2017, 10:42:38 AM »
VA currently allows users to run a command when a profile loads. I'd like to suggest that a similar option be added to run a command within the profile when the profile is unloaded (i.e., JUST before the current profile is switched away to a new profile).

Or more elegantly as Pfeil commented (http://voiceattack.com/smf/index.php?topic=901.0):
Quote
"Execute this command each time this profile is unloaded"

Thanks!


EDIT by Pfeil: This functionality was implemented.
« Last Edit: April 18, 2020, 11:39:40 AM by Pfeil »

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: Execute command each time profile is unloaded
« Reply #1 on: August 06, 2017, 08:33:58 AM »
@Gary: any feedback about the viability, priority (low I'm guessing), and possible time frame for this kind of feature?

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: Execute command each time profile is unloaded
« Reply #2 on: January 13, 2018, 09:22:28 AM »
Any thoughts about the feasibility of this kind of feature Gary? I think it would be an excellent addition to VoiceAttack's functionality!

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2824
Re: Execute command each time profile is unloaded
« Reply #3 on: January 13, 2018, 05:09:32 PM »
It seems very simple on the surface, but you get into the whole biz of having to monitor a command to figure out when it finishes so that VA can load the next profile and then there's what happens when VA is shutting down...  does it run the unload on shutdown or is that an option? does it behave differently if its a shutdown, etc).  So, I drag my feet on this, as although it's not a mindbender, it's definitely not trivial.

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: Execute command each time profile is unloaded
« Reply #4 on: January 13, 2018, 08:32:48 PM »
What if we thought about it more like injecting a command chronologically before an "execute a command each time this profile is loaded" action that is an option when the changed (new) profile loads? In other words, instead of trying to run a command as the last action before making a profile switch from A to B, could we run a command from profile A after profile B loads but before anything else can take place in profile B?

Maybe that way you could get around the "figure out when it finishes" and I think you wouldn't need to worry about shutdown issues either. Perhaps there could be a global setting that enables profiles to "receive" an injected command (from other profiles) and then the user can select in a given profile's options what command should be injected?

Does that make sense, lol?

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2824
Re: Execute command each time profile is unloaded
« Reply #5 on: January 13, 2018, 08:40:03 PM »
When A unloads, so does its commands.  It's why you'd have to keep it alive while the exit command is executing.

Exergist

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 405
  • Ride the lightning
Re: Execute command each time profile is unloaded
« Reply #6 on: January 13, 2018, 09:51:48 PM »
what about an "execute by name"?

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2824
Re: Execute command each time profile is unloaded
« Reply #7 on: January 13, 2018, 10:15:18 PM »
When A unloads, so does its commands.  There would be no command to execute another command.  It's gone.  Also, that would be a very, very specific function.

Gary

  • Administrator
  • Hero Member
  • *****
  • Posts: 2824
Re: Execute command each time profile is unloaded
« Reply #8 on: January 13, 2018, 10:19:28 PM »
There's also {PROFILE:x} and {PREVIOUSPROFILE} tokens that are in pre-beta to go along with the {SPOKENCMD:x} and {PREVIOUSSPOKENCMD} tokens.  Wondering if those would help for now  ?

I put a build out in the, 'unofficial' bin if you want it:  http://www.voiceattack.com/unofficial
« Last Edit: January 13, 2018, 10:34:59 PM by Gary »