Create and save filenames based upon today's date

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

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

Create and save filenames based upon today's date

Post by helpdsk » Thu Jan 02, 2003 10:55 pm

I sent a personal email to Marcus about this issue before I noticed that there was a forum for posting questions on Macro Scheduler 7.1 right here, so let me first apologize about that. Secondly, since it is already 10:00pm in London, England, right now, I don't think I will be hearing from Marcus before Monday. (Unless he loves working as much as I do. ) However, I am trying to get caught up (after goofing off during the holidays) by working over the weekend and could use any input anyone has on my question, hopefully before Monday if possible.

I am running a P III 800 MHz computer with 128 Mb RAM. My operating system is Windows 2000 Professional, and it is installed on the E: Drive using the FAT 32 file system. I am running a dual boot with Windows 98SE on the C: Drive. (If that could make any difference... I do not know.)

Once per day, I would like to record a 5 hour streaming RealAudio Internet Broadcast, even when I am not at my computer. So far, Macro Scheduler 7.1 has been able to help me perform all the functions I need to perform for this activity, except for using the file naming conventions that I want.

I would like to save each clip with a filename with two letters CC and then add those two letters to the rest of the filename which is based upon today's actual date, with the extension of .rm For example, CCmmddyy.rm I would like to store these files in a directory on my new 80 Gb hard drive called S:\Coast until I have the time to burn them to a CD-R.

I will be using software called Helix Producer Basic 9 to record my streaming Internet Broadcasts. This is actually free software provided by the RealAudio people. Here is the download URL if you think it is important to see how it works for yourself.


http://forms.real.com/rnforms/products/ ... 1041514291



I can also create a Title for each new clip that I save so that you know what it is when you right-click on it in Windows Explorer. I would like to have this Title be Coast to Coast - and then today's actual date once again. For example Coast to Coast - mmddyy



To save a file manually in this program

ALT F F type the filename you want Enter


To enter a title manually in this program

ALT S C type the Title you want Click the X in the upper right hand corner to close the box



Below you will find the section of the script I have been having trouble with. I have spent many hours studying the MacroScript Command Reference for Macro Scheduler 7.1 and testing different things out, but I just cannot seem to figure it out.

Would any of you folks either consider fixing what is wrong with my script or could you help me by creating a new one that will do the trick? Or could you maybe point me in the right direction? Don't worry, I will take full responsibility for whether or not your script works on my computer! If anybody wants my completed script, just let me know and I will publish it here or ask Marcus to publish it on the mjtnet.com website.

Make it a great day!

Edward




//Select Destination, Filename, And Title
Wait>5
GetDate>date
Let>title=Coast to Coast -
ConCat>title,date
Year>the_year
MidStr>year,3,2,year
Month>the_month
Day>the_day
Let>filename=S:\Coast\CC
Let>extension=.rm
ConCat>filename,the_year
ConCat>filename,the_month
ConCat>filename,the_day
ConCat>filename,extension
Wait>5
Press ALT
Send>f
Wait>5
Send>f
Send>filename
Wait>5
Press Enter
Wait>5
Release ALT
Wait>5
Press ALT
Send>s
Wait>5
Send>c
Wait>5
Send>title
Wait>5
Release ALT

//Close Window With Tiny X In The Upper Right Hand Corner
WindowAction>3,Clip Information - Untitled 1

Bilde
Junior Coder
Posts: 31
Joined: Fri Nov 15, 2002 3:19 pm
Location: Denmark

Post by Bilde » Thu Jan 02, 2003 11:22 pm

What does work in the script?
I don't know if it will help you, but have you tried to log or debug your macro?

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1352
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Thu Jan 02, 2003 11:36 pm

Hi Ernest,

This is a quick reply on the fly in response to the personal message you sent me. Unfortunately I'm in the middle of a project, so don't have time to look at this in detail, but I use the following lines to download a logfile from my web server, and save it using todays date. I hope this helps, but apologize if it doesn't.

Day>the_day
Month>the_month
Year>the_year

FTPGetFile>www.mysite.com,username,password,21,c:\my documents\logfiles\logs\%the_year%-%the_month%-%the_day%.txt,/logs/web.log,A

aquatech
Site Admin
Posts: 8
Joined: Fri Sep 20, 2002 12:23 am
Location: Australia
Contact:

Post by aquatech » Thu Jan 02, 2003 11:43 pm

Edward,

As you've not said what is wrong with your script I'm guessing from the private msg you sent me...

You're missing a couple of "the_" on your MidStr line for the Year calc. That should read:

MidStr>the_year,3,2,the_year

HTH.

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

"Save As" dialog box opens beautifully, then scrip

Post by helpdsk » Thu Jan 02, 2003 11:50 pm

"Save As" dialog box opens beautifully, the files of type field is highlighted, and then the script stops dead.

The Title part of the script doesn't seem to work at all.

I was up until 8:00am this morning trying to solve this problem, so I haven't been thinking too clearly today. But thanks for reminding me that I need to learn how to debug and log my scripts. I will do this tonight late into the evening and then over the weekend if necessary. Do you have any tips for me to follow before I read the manual on these two procedures?

Edward

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1352
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Thu Jan 02, 2003 11:53 pm

sorry Edward. I meant Edward, not Ernest.

Doh!

Bilde
Junior Coder
Posts: 31
Joined: Fri Nov 15, 2002 3:19 pm
Location: Denmark

Post by Bilde » Thu Jan 02, 2003 11:53 pm

hmm i'm wondering what about relasing alt before typing in the title?
does that help?

Ernest

Post by Ernest » Thu Jan 02, 2003 11:55 pm

Hi Helpdsk,
after a quick check:

...
Year>the_year
MidStr>the_year,3,2,the_year :!:
...
ConCat>filename,the_year
...

Code: Select all

//To send multiple shortcuts shouldn't be a problem
Send>ff
...

//Insert a wait before the input of the filename, as long as you won't use anything like WaitWindowOpen> etc.
Wait>5
...
Maybe there's another option, I'd prefer instead of moving around on a GUI
1. Save file with a fixed name e.g. "temp.rm" within Helix
2. Rename it on file level:

Code: Select all

Let>RP_WINMODE=0
Run Program>command /c move S:\Coast\temp.rm S:\Coast\CC%the_year%%the_month%%the_day%%extension%

E. (GMT+1) :!:
Eh, some questions are already answered by the MSchedGeeks while I'm fighting with that foreign language :lol:

Ernest

Post by Ernest » Fri Jan 03, 2003 12:15 am

Hi,
Bilde could be right. Without releasing ALT before you input the text/title could have had an impact. Cause you've said "the files of type field is highlighted":

(not released) ALT + Send>t(itle) means to jump to the file type section, and selecting file type "(t)itle" without success! (I've checked that with notepad)

:!:

E.

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

Wow! I thought you guys would all be busy

Post by helpdsk » Fri Jan 03, 2003 12:43 am

Wow! I thought you guys would all be busy with your lives and I wouldn't be hearing from anybody until Saturday evening or Sunday afternoon, if at all. But thanks for all your quick responses!

I am going to go now and try all the script changes everyone sent me and I will let you all know how things go. I also haven't eaten anything since 8:00am this morning and I need to go do that before all people see is a skeleton typing away at my keyboard. :wink:

So don't feel offended if I don't respond right away to anybody. I also promised to install some software at a client's office tonight, well before I knew how helpful you all were going to be, but I will be back again, hard at work, as quickly as I can. And then I will be up again until dawn here in Minnesota working on this problem. So feel free to contact me or post to the forum later.

Make it a great day!

Edward

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

Ready to Rock and Roll!

Post by helpdsk » Fri Jan 03, 2003 3:12 am

Ernest,

Like others have already said on this forum, you are a well-documented genius!

Just so the others that also responded to my problem don't feel offended, I opened up the Macro Scheduler Forum after eating dinner, and randomly selected your posts first, planning to perform all the suggested changes one by one from all the people who so kindly and swiftly responded to my question. Then I would run each of the changes on the script and see what happened. Well, I never got to any of the others and I was done in 10 minutes, thanks to you. It sounds like I am trying to give you a job reference, doesn't it? :lol:



First, I changed MidStr>the_year,3,2,the_year as you suggested.

Then I typed Release TAB immediately prior to both the filename and the Title commands.



And now my script works just swell, thank you very much!

I don't know if you guys are old enough to remember an American television show called The A Team but it starred George Peppard as one of the main characters. I think he was called Hannibal or something. Anyways, he would always be smoking a cigar and saying things like "I love it when a plan comes together!" And that is how I feel right now. I love watching my script type in all the right stuff, exactly when and where I want it. And it is all thanks to my new pal Ernest. So once again, thanks Ernest!

Just a few more questions Ernest. I am going to save this script in a safe place now that I have it, but I always like to tweak things to make them run just a "little more better". I looked at your suggestion to rename my file on a file level and use the code





Let>RP_WINMODE=0
Run Program>command /c move S:\Coast\temp.rm S:\Coast\CC%the_year%%the_month%%the_day%%extension%


.




What lines would I remove from my script and where would I add this new code suggestion of yours? It seems like a more elegant way of renaming files.

Any suggestions for changing the Title without moving around on a GUI, or am I just out of luck there?

Also, one more little thing I would like to have you help me tweak. In my script, today's date comes out as yymmdd.rm or CC030102.rm For better or for worse, I would like it to be the normal US standard of mmddyy or CC010302.rm. I know you know how I could change my script to read this way, so can you let me in on the secret?

Thanks to all for participating! People like you make it a joy to learn a new piece of software like Macro Scheduler. I am sure I will be back.

Again, if anybody wants this script, let me know and I will send it in.

Edward

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1352
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Post by Dorian (MJT support) » Fri Jan 03, 2003 3:28 am

If you're trying to change the name, and you are actually using something like :

CC%the_year%%the_month%%the_day%%

... you can just change this line to

CC%the_month%%the_day%%%the_year%

personally, i prefer to put dashes in the middle :

CC%the_month%-%the_day%-%%the_year%

Ernest

Post by Ernest » Fri Jan 03, 2003 9:31 am

Hi Hlpdsk,
as you've already mentioned: "... the A-Team". Mine was just to combine your "file type" with Bilde's "not released ALT" (that's McGyver-Style). :wink:

It looks like you can't get rid off to set a filename which should be renamed/replaced afterwards so here's not the great benefit i've expected by replacing the GUIMoves with a commandline solution :(

As H2K has pointed to: "what you set - is what you get", just rearrange the position of the variables to create the filename you need.

Ooops, there's an even more elegant way of moving files with MSched: MoveFile> 8) :!: (I'm a command line junkie on NT, so I often bypass MSched's command set. Sorry, Mr. T(ettmar) :wink: )

BTW: Have a check if Helix could run (with parameters) from the commandline :!:

:idea: What about to create an additional index as a HTML file:

Code: Select all

Let>song=<a href="file://S:\Coast\%filename%">%title%</a>
WLN>S:\Coast\index.htm,RESULT,%song%
but, don't forget the standart tags ... etc. :)

or as a CSV (to be used in Excel, Access, ...)

Code: Select all

TimeStamp>S:\Coast\index.csv,%title%
it's even better to work with if you have to search for titles/songs later.

Cheers
Ernest

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

Post by armsys » Fri Jan 03, 2003 12:34 pm

Hi Edward,

I missed the wonderful session and your private email while I was tied up by other projects. I'm sorry for not being able to help. Thanks you for sharing your Macro Scheduler scripting experience with us. Will you write a Macro Scheduler script for CD burning?

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

Ernest, one more quick question

Post by helpdsk » Fri Jan 03, 2003 12:46 pm

Made those changes as Ernest and the others suggested and my script is getting better by the minute, but I have one more question for you Ernest.

Is there a way to cause the GetDate>date command as I have it written in my script to either use mmddyy format or cause it to produce a date like January 3, 2003?

When my script types in the Title into the correct field for me, it looks like this Coast to Coast - 1/3/2003 and I would prefer one of the two ways I mentioned above.

Just another little tweak to make my script perfect. :wink:

Also, can you explain what it means when I use the command MidStr>the_year,3,2,the_year I used it, and it works, but I don't understand what I am doing when I use this command. What does MidStr do and what do the numbers 3,2 have to do with anything?

Also, do the following lines actually need to be typed exactly as I have them typed, or could I type them in any old order, just as long as they are there in the script someplace?




Year>the_year
MidStr>the_year,3,2,the_year
Month>the_month
Day>the_day

.



Could I type it in this way and would everything still work?




Day>the_day
Month>the_month
Year>the_year
MidStr>the_year,3,2,the_year
.



I could always type it in and test it, but maybe you know right off the bat, and you can save me some time.

Again, Ernest thanks for your help and to everyone else who sent in a reply to my problem, especially Bilde, aquatech and Horoscopes2000. If I left anybody out, I apologize and I do not mean to minimuze your contribution because now my script works great, thanks to all of you.

Horoscopes2000, I tried your CC%the_month%-%the_day%-%%the_year% idea and it really makes the filename really look swell, so thanks for that idea.

I have been testing my script for the past six hours and it seems to be working smoothly. I will just need to use it on a daily basis for a few weeks to see if I can break it. :)

Make it a great day!

Edward

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