Page 2 of 4
Re: Task Scheduler no longer talks to Audacity
Posted: Thu Oct 16, 2014 11:30 am
by Gale Andrews
Emerogork wrote:I do not see an option to attach a file.
Please see
http://forum.audacityteam.org/viewtopic ... 49&t=64936.
Gale
Re: Task Scheduler no longer talks to Audacity
Posted: Thu Oct 16, 2014 11:39 am
by Gale Andrews
Edgar wrote:Upon further testing what I am seeing is that if the last time I closed Audacity it was maximized to full screen then starting it via the Task Scheduler causes it to fail to become active/in focus. However, if the last time I closed Audacity it was not full screen then everything works just fine.
FWIW, I don't see that problem if launching Audacity 2.0.6 release or HEAD from the command-line on Win 7.
If it is a problem, then an appropriate command in the script should fix that.
Gale
Re: Task Scheduler no longer talks to Audacity
Posted: Thu Oct 16, 2014 5:07 pm
by Emerogork
The maximize and minimize options did nothing for me but I did find something that is much more bizarrer.
I was trying to see if the file had actually been called by the TS. In the AudacityInit.xml file, I added " <command> echo Here I am </command> " just before the command in the 4th to last line. The idea was to see the echo words to prove that the file had been called. No other changes were entered.
Well, although no echo comment was seen, the file now worked!!!
I remove the line, it stops. I re-enter the line, it works again.
How strange is that?
Now that Audacity initializes, I see the error statement:
"Audacity did not recognize the file 'C:Gork__Scheduled Event Scripts]InitializeAudacityB.au3"
The path is correct and the file is present. The purpose to call this script is to initialize Audacity yet it claim it cannot read the file.
Will wonders never cease....
Re: Task Scheduler no longer talks to Audacity
Posted: Thu Oct 16, 2014 5:56 pm
by Edgar
Emerogork wrote:I see the error statement:
Code: Select all
"Audacity did not recognize the file 'C:Gork__Scheduled Event Scripts]InitializeAudacityB.au3"
Is that close square bracket between Scripts & Initialize correct, the typo introduced when writing this email or an error?
Making it work by simply adding the failing Echo statement tells me that this is almost certainly a timing problem the "wait for window to activate" command (at least in other scripting languages with which I am more familiar) occasionally fails. It's been my experience with other scripting languages that the best solution is to wait at least 3-5 times the expected duration between launch & ready to use then search for the specific window by title.
Code: Select all
Sleep ( delay )
Parameters
delay Amount of time to pause (in milliseconds).
Code: Select all
WinActivate ( "title" [, "text"] )
Parameters
title The title of the window to activate. See Title special definition.
text [optional] The text of the window to activate.
Return Value
Success: Returns the handle of the window.
Failure: Returns 0 if window is not found or cannot be activated.
Remarks
You can use the WinActive function to check if WinActivate succeeded. If multiple windows match the criteria, the window that was most recently active is the one activated. WinActivate works on minimized windows. However, a window that is "Always On Top" could still cover up a window you Activated.
I see that I am a few years out of date in my AutoIt3 installation:
AutoIt v3.3.12.0 has been released.
AutoIt v3.3.12.0 – 1st June, 2014.
Re: Task Scheduler no longer talks to Audacity
Posted: Thu Oct 16, 2014 9:51 pm
by Emerogork
Yes, that was a typo. It should have been and not ]
First hurdle has been solved. Maybe the system is moving a bit faster lately and that is what may have been causing the first failure. Now I have to figure out why Audacity does not seem to want to see au3 files.
Re: Task Scheduler no longer talks to Audacity
Posted: Thu Oct 16, 2014 11:43 pm
by Edgar
Emerogork wrote: Now I have to figure out why Audacity does not seem to want to see au3 files.
What version of Audacity are you running?
Re: Task Scheduler no longer talks to Audacity
Posted: Fri Oct 17, 2014 12:39 am
by Emerogork
2.0.6 and it is a new installation. I uninstalled it after the problems showed up and reinstalled it to see if there was a corruption or something gone wrong. I had been running this long before the TS stopped communicating with Audacity.
As a test, I moved the script file to c: to check for a path problem but it still does not read it. I recreated the Task Scheduler event and used the browse to find the file. Still not working.
Something else going on is that the task manager is creating an instance of Audacity for each event. It is supposed to create it only for the initialize vent and only cause that instance to stop or stop recording by way of two other scripts
As it is now, when I activate the start script or stop script , it created additional Audacity instances instead.
Again, these scripts were not changed and were working before TS stopped talking to Audacity.
Re: Task Scheduler no longer talks to Audacity
Posted: Fri Oct 17, 2014 2:22 am
by Edgar
Emerogork wrote:2.0.6 and it is a new installation.
I know this is a lot to ask…would you consider reinstalling 2.0.5 to determine if your problems are related to the new version?
Re: Task Scheduler no longer talks to Audacity
Posted: Fri Oct 17, 2014 1:29 pm
by Gale Andrews
Emerogork wrote:Now that Audacity initializes, I see the error statement:
"Audacity did not recognize the file 'C:Gork__Scheduled Event Scripts]InitializeAudacityB.au3"
The path is correct and the file is present. The purpose to call this script is to initialize Audacity yet it claim it cannot read the file.
Is that a message box inside Audacity? If so, that error suggests to me Audacity was trying to import the file. Obviously it cannot do so.
Gale
Re: Task Scheduler no longer talks to Audacity
Posted: Fri Oct 17, 2014 2:37 pm
by Emerogork
I did not see that it was a message from within Audacity but I guess it is. It does seem that it is trying to import a file as audio and it clearly is not. I wonder how it changed from implement to import. When I clicked on the HELP button, it does discuss types of audio files to import.