Create and save filenames based upon today's date

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Jan 06, 2003 1:07 am

Cannot imagine what might be causing what you have described.

Try copying the script I provided into your macro folder. Then Create a new macro, and use Import. Be sure to save it under a new name.

==================================
To troubleshoot in Macro Scheduler, do the following:

1. Start Macro Scheduler from the System Tray, Start Menu, or your favorite method.

2. Open the script in the Editor.

3. Click on Debug, and be sure to have a check mark to Show Watch List.

4. Press CTL-HOME to get to the beginning of the Macro script.

5. Press F8, or click on Debug, Step, to start the debug process. It will take a moment for Macro Scheduler to copy the macro into memory.

6. Continue to press F8 on each line of code. Looking in the Watch List on the right, you will be able to see the results of each line of code as it is executed.

7. If you stop Debug at any time, (Icon to Stop Debug, or CTL-F2, or click on Debug, Stop Debug), be sure to go back to beginning if you restart Debug or you will lose the values of variables that might be needed.

8. If you move the cursor, or edit lines while Debugging, you may lose your reference point while single stepping. The macro will continue to process the original values that were there when you first pressed F8.

9. You may also have some problems with delays on the CTL/ALT/SHIFT key combinations in other windows. You will just have to learn to work with these while single stepping. Sometimes you may have to manually activate certain items that you are expecting the Macro to do.

=========================
This process is invaluable to the debugging process. Good luck.....
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Mon Jan 06, 2003 1:09 am

Hi Bob & Edward,

PMJI, for the repeating the keystrokes such as:
//Start Encoding Process

Press TAB
Press TAB
Press TAB
Press TAB
Press TAB
Press TAB
Press TAB
Press TAB
Press TAB
Press TAB
Press TAB
Press TAB
Press TAB


can be abbreviated as:
Press TAB *13

Edward,

You can abort your script running by pressing Shift-Esc. After you gain control, you should first look up and clean up all error messages, if any.

To troubleshoot a mysterious script, I always scatter the script with echo messages:


Message>Success 1
...
Message>Success 2


so that I know where the trouble spot is.

helpdsk
Newbie
Posts: 19
Joined: Thu Jan 02, 2003 10:15 pm
Location: Saint Paul, Minnesota

Give credit where credit is due

Post by helpdsk » Mon Jan 06, 2003 1:15 am

Bob,

I will be happy to include your signature here at the Forum in any scripts that I use of yours. But please expect to get a few phone calls or emails that you might not be expecting.

I'm just glad you could be of assistance to me and I am sure others will feel the same.

Edward
Things should be made as simple as possible -- but no simpler.

Albert Einstein

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Jan 06, 2003 1:18 am

Good suggestions Armstrong...

They also reminded my about the log file. Each script can have a log file recorded. This does not work in Debug mode, but it does record when a script is RUN.

In the Macro Properties, go to the tab for logging. Be sure to have a checkmark in "Log Progress of Macro", and enter a file name similar to the macro name.

After you have RUN the macro, go to the Main Manager Screen for Macro Scheduler. Click on Tools, View Log File. You will see which lines of code were actually executed, and you will see the values of all variables as they were included in the script lines.

Happy Debugging to you.............. :D
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

helpdsk
Newbie
Posts: 19
Joined: Thu Jan 02, 2003 10:15 pm
Location: Saint Paul, Minnesota

Feel free to jump in any time

Post by helpdsk » Mon Jan 06, 2003 1:28 am

Armstrong,

Feel free to jump in any time when you have information like that to share! :!:

The Press TAB *13 command will really clean up my script a lot because what you saw in this short clip was about 1/10 of the number of times TAB appears in the other parts of my script.

Edward
Things should be made as simple as possible -- but no simpler.

Albert Einstein

helpdsk
Newbie
Posts: 19
Joined: Thu Jan 02, 2003 10:15 pm
Location: Saint Paul, Minnesota

Debugging process stopped at

Post by helpdsk » Mon Jan 06, 2003 2:35 am

I stepped through the process as you suggested using the debugger and found that the computer was locking up at
MidStr>%YYYY%,3,2,YY
.

I am hoping that there has been a typo made somewhere. I know you probably need to go do something else right now, but could you check it again for me tomorrow or so? Here is the immediate code surrounding this problem area, and of course you have the rest of the script.
Label>CheckYear
Length>%YYYY%,len
If>%len%=4,DatesDone
//Next line is only for 21st century dates
Let>YYYY=20%YYYY%
//Next line is for 2 digit year values
MidStr>%YYYY%,3,2,YY
//Now have full values for MM, DD, YYYY, and for YY
Label>DatesDone
Edward
Things should be made as simple as possible -- but no simpler.

Albert Einstein

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Jan 06, 2003 5:33 am

Hi Edward.....

You mention that the computer was locking up on the line for
MidStr>%YYYY%,3,2,YY. I can't duplicate that, but I did take a closer look at the lines in that area.

My system actually had 4 digit year and did not step through those few lines of code. (It was only added to have a 2 digit YY available if needed later, not actually used in any of this code).

But in reviewing it, it did appear to be in the wrong location, it would only run if you had a 2 digit year. Thanks for forcing a tougher testing process.

I have moved it according to the instructions following here.

Existing code now:
Line
1 Label>CheckYear
2 Length>%YYYY%,len
3 If>%len%=4,DatesDone
4 //Next line is only for 21st century dates
5 Let>YYYY=20%YYYY%
6 //Next line is for 2 digit year values
7 MidStr>%YYYY%,3,2,YY
8 //Now have full values for MM, DD, YYYY, and for YY
9 Label>DatesDone

Changes:
Insert a blank line after line 5.
Move line 9 after the blank line to before line 6.

Resulting code after changes:
Line
1 Label>CheckYear
2 Length>%YYYY%,len
3 If>%len%=4,DatesDone
4 //Next line is only for 21st century dates
5 Let>YYYY=20%YYYY%
6
7 Label>DatesDone
8 //Next line is for 2 digit year values
9 MidStr>%YYYY%,3,2,YY
10 //Now have full values for MM, DD, YYYY, and for YY

====================================
I don't think this would actually cause your problem. But I suspect that an extra space somewhere might be the problem. I added a space to the line in question and my system did not hang, I just got a variable named "YY ", (which I wasn't using anyway). So perhaps that might be happening on another line.

Be sure that there are no extra spaces at the end of any lines that you copied from this forum. If you are using the latest version (7.1.13) you can see visible spaces by clicking on Edit, Show All Characters.

Let me know what you find. It sounds like you are learning how to Debug with single step, or with your log. That is good progress. If the problem continues, send a copy of the log file and I will review it.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

helpdsk
Newbie
Posts: 19
Joined: Thu Jan 02, 2003 10:15 pm
Location: Saint Paul, Minnesota

Post by helpdsk » Mon Jan 06, 2003 11:21 am

Bob

Everything works great now so we have made good progress, indeed! :D And I certainly appreciate all your help. If you can hang in there for just a few more questions, I would like to get your input on making a few more tweaks to make our little script perfect for my needs.

Of course, the first thing I did was make the changes to the script line order as you suggested. Then I clicked on Edit > Show all characters from the menu and indeed found an extra space on every single line I had pasted from the script you sent me through the forum. Apparently, Macro Recorder had used the spaces as part of the variable names, thus throwing off the final results.

:idea: You should pat yourself on the back for thinking of that one and tell it to any other newbies to the Macro Scheduler site. I do not know how much pull you have with the MJTNET people, but I think it would be great if you could have them enter it into the FAQ for us silly newbies to read, and it would be even better if you could get them to incorporate it into the default verbage on the page that appears after you click the [Post Reply] button.

As you know, I am running Windows 2000, and I want to know if I can start Macro Scheduler with the System Scheduled Tasks Applet in Control Panel. Or, does Macro Scheduler need to run all the time as a process down by the clock? If it needs to run all the time down by the clock, is there a way that I can lock Macro Scheduler so that no one else in my family except for me can shut it down?

Can we make our Splash Screen taller, or is it just "one size fits all"? I would like to have our Splash Screen say the following on additional lines in a "hard-coded" sort of way
Default Settings Restored
SoundMAX Digital Audio
Audio Mode Set To Voice
64k Single ISDN 50kbps
Otherwise, if it is just "one size fits all", I could shorten the above lines and enter them all on the last and final line on our existing Splash Screen. The hard coding could be shortened to
Default, SoundMAX, Voice, 50kbps
I would like to have the Splash Screen shut down by itself because I want to be able to run this macro when I am not in front of the machine. On the other hand I would like to be able to read the Splash Screen if I happen to be in front of the machine when the macro starts. Is there a way for us to do that?

After the Splash Screen shuts down automatically, I need to shift the attention back to the main window which is called
Helix Producer Basic - Untitled 1
After our Splash Screen came up, the script was to run the following command
Goto>End
I deleted this and the associated command
Label>End
because the script jumped over creating and saving the Filename as well as creating the Title for the audio clip. We could not have that, could we? Do we need to use the End commands in some other location?

You will be happy to know that I went to the Control Panel on my Windows 2000 computer and opened the Regional Options Applet. Then I changed the short date format to the following 4 settings, and ran the script 4 different times.
M/d/yy
M/d/yyyy
MM/dd/yy
MM/dd/yyyy
Each of the 4 times, the script ran the way you programmed it to run.

Is it possible to adjust our script to cause the Title to read
January 5, 2003
or January 05, 2003,
whichever is easier? I still want to leave the script the way it is, but I would like to have you add this as an option to the script. Maybe you could use leading front slashes to enable and disable this option, and show me what changes to the script I would need to make to enable and disable this option myself.

As soon as the macro types the Title entry for me, the macro shuts down immediately. I thought we had the macro set to shut down in 5 hours and 5 minutes. Now, keep in mind that it is not so much the macro that I want to shut down in 5 hours and 5 minutes, but I want the Helix program to shut down after that time. Will the macro start back up so that it can shut down Helix program, or according to our script, how could we make that work?

To shut down the program manually at this point, a person would need to perform the following steps
Press Tab *15
Press ALT
Wait>5
Send>f
Wait>5
Sent>x
Things should be made as simple as possible -- but no simpler.

Albert Einstein

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Shut down Helix Producer Basic

Post by armsys » Mon Jan 06, 2003 11:53 am

Hi Edmond,

The following MacroScript should help shut down the window:
// Wait exactly 5 hours 5 minutes
Wait>18300
Press TAB *15
CloseWindow>Helix Producer Basic*

When a MacroScript is running, interfering the keyboard may cause serious trouble. Yes, you can call multiple scripts but they are just queued up. Pressing Shift-Esc is the only way to abort the running Macro Script. While a MacroScript is running, the keyboard can't be locked per se to prevent interruption.

Ernest

Post by Ernest » Mon Jan 06, 2003 12:22 pm

Hell, isn't there something which reminds me at a chat? :wink:
If you post multiple issues in one request there's a good chance that a bunch of geeks working at the same issue in parallel. It would help a litlle if you split your request into single issues! Otherwise it will waste someones live/time unnecessarilly. :? Or you switch back to the one2one mode :lol:

SplashScreen (the MSched Message>?):

Code: Select all

Message>Default Settings Restored%CRLF%SoundMAX Digital Audio%CRLF%Audio Mode Set To Voice%CRLF%64k Single ISDN 50kbps
//here you've to set your favourite wait method
Wait>5
CloseWindow>Macro Scheduler Message*
To resize a MessageBox see my posting "PBar is born".

To bring the "attention" back to a window:

Code: Select all

SetFocus>Helix Producer Basic - Untitled 1
January 5, 2003 or January 05, 2003:
You've already requested that. Solved. See my (ignored :?:) posting days ago.

Have phun,
Ernest

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Tue Jan 07, 2003 8:30 am

In addition to other questions, Edward asks:
Is it possible to adjust our script to cause the Title to read

January 5, 2003
or January 05, 2003,

I think isolated topics are easier to follow, and I thought that this topic was getting too confusing with too many different questions. So I have added a new topic, "Month Names in Filenames" to address this specific question.

I'd like to suggest that additional comments on this subject be continued under the new topic. I would also encourage others to take a similar approach on any of the previous questions that Edward has brought up.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts