File Dates

General Macro Scheduler discussion

Moderators: JRL, Dorian (MJT support)

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 May 10, 2005 6:35 pm

Show us the exact code, cut/paste, do not retype it. Since it stops right away, may only need first few lines.

In the WatchList, what is the value of path?

In the log, show us the resutls.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Quicker me

Post by macrunning » Tue May 10, 2005 6:38 pm

Is there a faster way for this to execute?

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

CODE SNIPPET

Post by macrunning » Tue May 10, 2005 6:41 pm

Here is the code I am using

Let>path=C:\Program Files\Apache Group\Apache\htdocs\fordofkirkland\

GetFileList>%path%photos*.*,files

Separate>files,;,file_names

Day>the_day

Month>the_month

Year>the_year

Let>k=0

Repeat>k

Let>k=k+1

//Get the date of the file

FileDate>file_names_%k%,fdate

if>fdate=%the_year%%the_month%%the_day%

//FileDate matches today's date, local_file is current file

Let>local_file=file_names_%k%

//remove path from local_file to get remote file name

StringReplace>local_file,path,,remote_file

//ftp the file, modify next line for server,user,pass, remote directory, txfer mode

FTPPutFile>host,username,password,21,local_file,/public_html/photos/%remote_file%,I

endif

Until>k,file_names_count

Goto>nextUpload

Label>nextUpload

//looks like you are uploading image files? If so transfer mode for FTP tx will be I

Let>path=C:\Program Files\Apache Group\Apache\htdocs\nwforddealers\photos

GetFileList>%path%71260*.*,files

Separate>files,;,file_names

Day>the_day

Month>the_month

Year>the_year

Let>k=0

Repeat>k

Let>k=k+1

//Get the date of the file

FileDate>file_names_%k%,fdate

if>fdate=%the_year%%the_month%%the_day%

//FileDate matches today's date, local_file is current file

Let>local_file=file_names_%k%

//remove path from local_file to get remote file name

StringReplace>local_file,path,,remote_file

//ftp the file, modify next line for server,user,pass, remote directory, txfer mode

FTPPutFile>host,username,password,21,local_file,/public_html/photos/%remote_file%,I

endif

Until>k,file_names_count

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 May 10, 2005 6:52 pm

I am having no problem single stepping, steps thru code OK
I am seeing values assigned correctly in WatchList
I am able to run real time with no errors up to MessageModal that I inserted just before loop.
=============================

When you say it stops at first line, please explain what you are doing, how are you running this, what screen are you starting from?
You have not provided any log contents.
You did not provide value of path from WatchLIst.

What are we missing in the communication here?

=
OR am I out of sync right now? Are you saying it now works, but too slowly?
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Sorry Bob

Post by macrunning » Tue May 10, 2005 6:57 pm

Sorry Bob,
I wasn't trying to be difficult. What is the 'WatchList' you are referring to.
I figured out why it wasn't going beyond line one. I was simply being a hamster on a wheel and not thinking. Stupid me figured that part out thats why I didn't post anything else on it. Also I don't have a log for the script. I'm still learning. Is this something I set up in the script or is it automatic with the Macro Sheduler?
and yes to your last question. I've got it running. I set it up on trace and watch it loop through the repeat but for some reason I feel it is taking to long. Maybe its just me being impatient but I thought it might run quicker, so I was asking if there is a quicker way of this running.

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 May 10, 2005 7:20 pm

Congrats that you and Support got it done!

I suspect the speed may not be changeable unless you change your FTP process. Rather than calling FTP for every file, you might want to see if you can add the files to a zip file and do one FTP at the end. Or you may be able to do fewer FTPs using wildcards for the filenames. (I never tried FTPPut with wildcard, not sure it will work, but other ftp tools could be called with RunProgram). But basically I am suggesting that you make the list of files to be uploaded first, then exit the loops and do all FTP at one time.

Re WatchList:
Open Editor, From the Editor Menu: Debug,Dhow WatchList.
Then move curstor to top of script and Debug,Step and you will be able to see the variables in the Macro Scheduler script. You will not see anything in your VBScript, that will just run.

Re Log:
Save your macro
From the Macro Scheduler main window (Control Panel), right click on Macro Name, select Properties. Go to tab for Logging.
Put a check to Log Progress of Macro. Fill in other values as desired.
In lower section, I usually use the 2nd option to Log Entry before running script.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue May 10, 2005 7:25 pm

Does it matter how long it takes? Isn't the advantage of this that it is a process that can happen automatically and unattended? So leave it running and go do something else, or schedule it to run overnight.
MJT Net Support
[email protected]

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Crazy or not?

Post by macrunning » Tue May 10, 2005 7:29 pm

So is it crazy of me to think that I've had this script running for the last 20 minutes or so and nothing is happening? I have a few hundred photo files in the folder.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue May 10, 2005 7:40 pm

It isn't crazy of you to ask that question, no. That's why you'd want to set up logging and look at the log file. Also do you have FTP_STATUS set so you can see the FTP status window - which by default appears in top left? Does it show any progress?

Did you modify the FTPPutFile line to give it a valid ftp server, username, password, port and path?
MJT Net Support
[email protected]

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Just a thought

Post by macrunning » Tue May 10, 2005 7:40 pm

Well heres my thought, I would like to know if it's working?

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Another thought

Post by macrunning » Tue May 10, 2005 7:42 pm

Yup modified the FTPPutFile to go to my server, but I didn't know about the FTP_STATUS window so I will set that up on the next run. I'll also set up the log file. Thanks.

User avatar
support
Automation Wizard
Posts: 1450
Joined: Sat Oct 19, 2002 4:38 pm
Location: London
Contact:

Post by support » Tue May 10, 2005 7:43 pm

Of course you would - hence my last post. One obvious way is to look at the FTP server and see if your files are there. But please also see my last post and answer the questions there.

If nothing at all is happening then one would have to assume the FTP line is wrong.
MJT Net Support
[email protected]

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Turned on the log and set up another test.

Post by macrunning » Tue May 10, 2005 8:10 pm

Ok I set up a test folder this time with only a few photo files in it. I thought this might be quicker. I also turned on the log file. Below is part of the results I got. It just repeats for several hundred more lines but you can get the gist of it I'm sure from what I copied. It doesn't appear to be getting the file name for some reason? I also took a look at the server and no new pic files were uploaded. I also set the FTP_STATUS>1 but it never came up.

5/10/2005 12:54:44:438 - Started Macro : test2
5/10/2005 12:54:44:438 - Let>path=C:\Program Files\Apache Group\Apache\htdocs\fordofkirkland\
5/10/2005 12:54:44:438 -
5/10/2005 12:54:44:448 - GetFileList>C:\Program Files\Apache Group\Apache\htdocs\fordofkirkland\test*.*,files
5/10/2005 12:54:44:448 -
5/10/2005 12:54:44:448 - Separate>files,;,file_names
5/10/2005 12:54:44:448 -
5/10/2005 12:54:44:448 - Day>the_day
5/10/2005 12:54:44:448 -
5/10/2005 12:54:44:448 - Month>the_month
5/10/2005 12:54:44:448 -
5/10/2005 12:54:44:448 - Year>the_year
5/10/2005 12:54:44:448 -
5/10/2005 12:54:44:448 - Let>k=0
5/10/2005 12:54:44:448 -
5/10/2005 12:54:44:448 - Repeat>k
5/10/2005 12:54:44:448 -
5/10/2005 12:54:44:458 - Let>k=k+1
5/10/2005 12:54:44:458 -
5/10/2005 12:54:44:458 - //Get the date of the file
5/10/2005 12:54:44:458 -
5/10/2005 12:54:44:458 - FileDate>file_names_1,fdate
5/10/2005 12:54:44:458 -
5/10/2005 12:54:44:458 - endif
5/10/2005 12:54:44:458 -
5/10/2005 12:54:44:458 - Until>k,file_names_count
5/10/2005 12:54:44:458 - /*
5/10/2005 12:54:44:458 - Label>nextUpload
5/10/2005 12:54:44:458 -
5/10/2005 12:54:44:458 - //PHOTO UPLOADS FOR KIRKLAND ONTO NWFORDDEALERS.com
5/10/2005 12:54:44:468 - //looks like you are uploading image files? If so transfer mode for FTP tx will be I
5/10/2005 12:54:44:468 -
5/10/2005 12:54:44:468 - Let>path=C:\Program Files\Apache Group\Apache\htdocs\nwforddealers\photos\
5/10/2005 12:54:44:468 -
5/10/2005 12:54:44:468 - GetFileList>C:\Program Files\Apache Group\Apache\htdocs\nwforddealers\photos\71260*.*,files
5/10/2005 12:54:44:468 -
5/10/2005 12:54:44:468 - Separate>files,;,file_names
5/10/2005 12:54:44:468 -
5/10/2005 12:54:44:468 - Day>the_day
5/10/2005 12:54:44:468 -
5/10/2005 12:54:44:468 - Month>the_month
5/10/2005 12:54:44:468 -
5/10/2005 12:54:44:468 - Year>the_year
5/10/2005 12:54:44:468 -
5/10/2005 12:54:44:478 - Let>k=0
5/10/2005 12:54:44:478 -
5/10/2005 12:54:44:478 - Repeat>k
5/10/2005 12:54:44:478 -
5/10/2005 12:54:44:478 - Let>k=k+1
5/10/2005 12:54:44:478 -
5/10/2005 12:54:44:478 - //Get the date of the file
5/10/2005 12:54:44:478 -
5/10/2005 12:54:44:478 - FileDate>file_names_1,fdate
5/10/2005 12:54:44:478 -
5/10/2005 12:54:44:478 - endif
5/10/2005 12:54:44:478 -
5/10/2005 12:54:44:478 - Repeat>k
5/10/2005 12:54:44:488 -
5/10/2005 12:54:44:488 - Let>k=k+1
5/10/2005 12:54:44:488 -
5/10/2005 12:54:44:488 - //Get the date of the file
5/10/2005 12:54:44:488 -
5/10/2005 12:54:44:488 - FileDate>file_names_2,fdate
5/10/2005 12:54:44:488 -
5/10/2005 12:54:44:488 - endif
5/10/2005 12:54:44:488 -
5/10/2005 12:54:44:488 - Repeat>k
5/10/2005 12:54:44:488 -
5/10/2005 12:54:44:488 - Let>k=k+1
5/10/2005 12:54:44:488 -
5/10/2005 12:54:44:488 - //Get the date of the file
5/10/2005 12:54:44:498 -
5/10/2005 12:54:44:498 - FileDate>file_names_3,fdate
5/10/2005 12:54:44:498 -
5/10/2005 12:54:44:498 - endif
5/10/2005 12:54:44:498 -
5/10/2005 12:54:44:498 - Repeat>k
5/10/2005 12:54:44:498 -
5/10/2005 12:54:44:498 - Let>k=k+1
5/10/2005 12:54:44:498 -
5/10/2005 12:54:44:498 - //Get the date of the file
5/10/2005 12:54:44:498 -
5/10/2005 12:54:44:508 - FileDate>file_names_4,fdate
5/10/2005 12:54:44:508 -
5/10/2005 12:54:44:508 - endif
5/10/2005 12:54:44:508 -
5/10/2005 12:54:44:508 - Repeat>k
5/10/2005 12:54:44:508 -
5/10/2005 12:54:44:508 - Let>k=k+1
5/10/2005 12:54:44:508 -
5/10/2005 12:54:44:508 - //Get the date of the file
5/10/2005 12:54:44:508 -
5/10/2005 12:54:44:508 - FileDate>file_names_5,fdate
5/10/2005 12:54:44:508 -
5/10/2005 12:54:44:508 - endif
5/10/2005 12:54:44:518 -
5/10/2005 12:54:44:518 - Repeat>k
5/10/2005 12:54:44:518 -
5/10/2005 12:54:44:518 - Let>k=k+1
5/10/2005 12:54:44:518 -
5/10/2005 12:54:44:518 - //Get the date of the file
5/10/2005 12:54:44:518 -
5/10/2005 12:54:44:518 - FileDate>file_names_6,fdate
5/10/2005 12:54:44:518 -
5/10/2005 12:54:44:518 - endif
5/10/2005 12:54:44:518 -
5/10/2005 12:54:44:518 - Repeat>k
5/10/2005 12:54:44:518 -
5/10/2005 12:54:44:518 - Let>k=k+1
5/10/2005 12:54:44:528 -
5/10/2005 12:54:44:528 - //Get the date of the file
5/10/2005 12:54:44:528 -
5/10/2005 12:54:44:528 - FileDate>file_names_7,fdate
5/10/2005 12:54:44:528 -
5/10/2005 12:54:44:528 - endif
5/10/2005 12:54:44:528 -
5/10/2005 12:54:44:528 - Repeat>k
5/10/2005 12:54:44:528 -
5/10/2005 12:54:44:528 - Let>k=k+1
5/10/2005 12:54:44:528 -
5/10/2005 12:54:44:528 - //Get the date of the file
5/10/2005 12:54:44:528 -
5/10/2005 12:54:44:538 - FileDate>file_names_8,fdate
5/10/2005 12:54:44:538 -
5/10/2005 12:54:44:538 - endif
5/10/2005 12:54:44:538 -
5/10/2005 12:54:44:538 - Repeat>k
5/10/2005 12:54:44:538 -
5/10/2005 12:54:44:538 - Let>k=k+1
5/10/2005 12:54:44:538 -
5/10/2005 12:54:44:538 - //Get the date of the file
5/10/2005 12:54:44:538 -
5/10/2005 12:54:44:538 - FileDate>file_names_9,fdate
5/10/2005 12:54:44:538 -
5/10/2005 12:54:44:538 - endif
5/10/2005 12:54:44:548 -
5/10/2005 12:54:44:548 - Repeat>k
5/10/2005 12:54:44:548 -
5/10/2005 12:54:44:548 - Let>k=k+1
5/10/2005 12:54:44:548 -
5/10/2005 12:54:44:548 - //Get the date of the file
5/10/2005 12:54:44:548 -
5/10/2005 12:54:44:548 - FileDate>file_names_10,fdate
5/10/2005 12:54:44:548 -
5/10/2005 12:54:44:548 - endif
5/10/2005 12:54:44:548 -
5/10/2005 12:54:44:548 - Repeat>k
5/10/2005 12:54:44:548 -

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Post by macrunning » Tue May 10, 2005 8:22 pm

Ok I added a slash after test in the GetFileList> line.
Then I even saw the ftp status window. It appeared to be uploading the images, I haven't been able to find them on the server yet???

macrunning
Pro Scripter
Posts: 68
Joined: Wed May 04, 2005 10:24 pm

Some Progress

Post by macrunning » Tue May 10, 2005 8:27 pm

So the FTP_STATUS window shows. Then it flashes a few times but I can't read it because it runs to fast. It would appear to be uploading the image files but when I check the remote folder, there is nothing in there. Any ideas. Oh, and it is running much quicker!!!

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