Jump to content
Macro Express Forums

Repeat with Folder: order of processing?


Recommended Posts

This minor issue is no doubt due to some setting about sorting sequence either in ME Pro or XP, but I'd appreciate a heads up if there is a simple fix please.

 

I'm using the Repeat with Folder command to work on the subfolder names within the target folder. I'd like the processing in the same order as the subfolders are displayed in the Explorer folder.

 

For example, if have this target C:\Test ME Pro containing the following

 

_Folder1
_Folder2
Folder3
Folder4

 

and I run this macro (set to return Folders only)

 

Repeat with Folder C:\Test ME Pro
Text Box Display: Folder name
End Repeat

 

then I want the successive messages to appear in the above order. But instead I get

 

Folder3
Folder4

_Folder1
_Folder2

 

--
Terry, East Grinstead, UK

Link to comment
Share on other sites

Simple fix? Switch to WIndows 7 or 8. ;)

 

Are you using NTFS or FAT32 on your Windows XP system? It may be that you just need to upgrade to NTFS.

 

Here's what happens: Macro Express requests the files in a certain folder. On Windows XP (or FAT32) information for the files is returned in the order they were written to the disk drive. On Windows Vista and later (or, possibly on an NTFS system) when Macro Express requests the files from Windows they are returned in alphabetical order.

 

When you use Windows Explorer it sorts the list of files based on your sort criteria. They may be alphabetical, by file type or modified date.

 

As a workaround you could store the list of files in an array and then have a macro sort the array.

Link to comment
Share on other sites

There are also differences in sort rules. In the past I've often noticed cleverness with Windows File Explorer like recognizing a series of file names begin with numbers and sorting them numerically instead of alphabetically. Once I even had a media folder of movies and it ignored initial articles like the word "The" in the alphabetization. But even at the command prompt I've seen a different order to a directory list. I think the main reason is because MEP is written in Delphi and it's classes have different ideas about the proper way to organize like putting special characters first. Anyway my point is that even within Windows File Explorer there can be different rules based on content and display options.

 

The only fix I could see would be to see if using a VBScript or batch file to make a file name list to then process with. It might be more likely to make a list in the same order as what you're seeing.

Link to comment
Share on other sites

Thanks all. Files are all NTFS.

 

@Samrae: If I've understood you correctly, ME Pro processes this command 'correctly' in Window 7/8 but differently in XP. Anyone know why? Any NTFS/FAT32 distinction appears irrelevant in my case.

 

So I'll resort the results after the processing.

 

--
Terry, East Grinstead, UK

Link to comment
Share on other sites

There are also differences in sort rules. In the past I've often noticed cleverness with Windows File Explorer like recognizing a series of file names begin with numbers and sorting them numerically instead of alphabetically. Once I even had a media folder of movies and it ignored initial articles like the word "The" in the alphabetization. But even at the command prompt I've seen a different order to a directory list. I think the main reason is because MEP is written in Delphi and it's classes have different ideas about the proper way to organize like putting special characters first. Anyway my point is that even within Windows File Explorer there can be different rules based on content and display options.

 

The only fix I could see would be to see if using a VBScript or batch file to make a file name list to then process with. It might be more likely to make a list in the same order as what you're seeing.

 

Thanks, Cory, that sounds right about ME Pro using different sort rules. In the absence of a simple tweak or something I'll just accept the results ME Pro delivers and re-sort them afterwards.

 

--

Terry, East Grinstead, UK

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...