Jump to content
Macro Express Forums

Open Newest File in Folder


Recommended Posts

Hello all, thank you for taking the time to read.

 

I am attempting to create a macro that will parse some information from an HTML file that is created in a temp directory by a program that I am running. Essentially one must type in a user's ID and this will generate a temporary HTML file with relevant information inside of it. Since a brand new HTML file (with a different file name) is generated each time a new user ID is entered, there's no way to actually just pull information from the same temp file. Is it possible to request that macro express open the most recently created file in a folder?

 

Thanks

Link to comment
Share on other sites

There is no direct way I know of. I do this quite often and my technique is to repeat with folder and put the date/time of the file in a date/time variable. I cache the date/time and file name. on the first iteration and on each subsequent iteration compare. If greater I cache the new date/time and file name. When the loop is exited use the cached file name.

Link to comment
Share on other sites

First you use the Repeat With Folder command with the File option to put a file path\name in a variable and for each file you use the Variable Set From File command with the Get File Date/Time and To Date Var options.

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...
×
×
  • Create New...