GetFileList for Directories?

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Dexter1
Pro Scripter
Posts: 64
Joined: Mon Jun 19, 2006 3:28 pm

GetFileList for Directories?

Post by Dexter1 » Tue Mar 03, 2009 5:10 pm

Every week I generate a new folder in a specific directory. I always use the same naming convention: WK#_YYYY. This week I created WK8_2009. In two weeks I will create WK10_2009, and on, one for each week of the year.

I am currently using a macro to generate this folder but I have to enter the week number. I would like to bypass this step and automatically generate the new folder.

However, I have not yet been able to use GetFileList properly (assuming this is the right way to go?). The manual says Let>GFL_TYPE=1 should give me directories instead of files, but I haven't been able to make that work. Below is the code I have.

If there is another way I should be doing this, I'm all ears, but my basic plan was to get a list of file names, find the one with the highest week number, then create a new folder that is one higher.

I guess a bonus would be to start a new year if it hits 52 but that's not a big deal.

Code: Select all

Let>GFL_TYPE=1
GetFileList>\\rnodata01\scrub$\Production_Issues_Clarify\**,directories
Separate>directories,;,file_names
MessageModal>%directories%
Thanks,
Josh

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Mar 03, 2009 5:15 pm

The only error I can see in your code is that you have missed out a dot (.) between * and *. Your code works for me (all-be-it with a different network path):

Let>GFL_TYPE=1
GetFileList>\\MadeUpServer\Shares\Marcus\*.*,directories
Separate>directories,;,file_names
MessageModal>%directories%
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

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 Mar 03, 2009 5:18 pm

Are you missing a period .?

GetFileList>\\rnodata01\scrub$\Production_Issues_Clarify\*.*,directories
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

Dexter1
Pro Scripter
Posts: 64
Joined: Mon Jun 19, 2006 3:28 pm

Post by Dexter1 » Fri Mar 06, 2009 8:22 pm

I added the period but still get a list of all of the files in the folder. In fact, I don't get any directory names at all, just files.
Thanks,
Josh

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Mar 06, 2009 8:30 pm

Which version of Macro Scheduler are you running?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Dexter1
Pro Scripter
Posts: 64
Joined: Mon Jun 19, 2006 3:28 pm

Post by Dexter1 » Fri Mar 06, 2009 9:01 pm

An old one!

8.0.4
Thanks,
Josh

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Mar 06, 2009 9:20 pm

That'll be it then. GFL_TYPE was added later:

http://www.mjtnet.com/mswhatsnew.htm
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Dexter1
Pro Scripter
Posts: 64
Joined: Mon Jun 19, 2006 3:28 pm

Post by Dexter1 » Fri Mar 06, 2009 10:44 pm

Ah! Thanks.

I'll have to see if I can talk my boss into the upgrade without having to trade my job for it.
Thanks,
Josh

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