Jump to content
Macro Express Forums

Append to filename using Process Folder macro


Recommended Posts

I'm using the Process Folder macro to go through a directory of files and process them in a program. But, I need to append some text to the filename each time I finish the processing. The Process Folder scripts reads the filenames into the array %T[1]% and iterates through the array. When I need to save the file that just been processed, I need to add "_LE" to the end of the filename without changing the extension. For example: the original file might be named foo.bar but I need to name the newly processed file as foo_LE.bar. I assume I could split the text into parts somehow and concatenate afterwards.

 

Thanks,

Mark

Link to comment
Share on other sites

Thanks rberq.

 

I think I accomplished the same thing with this ugly hack:

Repeat with Folder C:\foo\bar
Variable Set String %FileExt% to "%T[1]%"
Split String "%FileExt%" on "." into %parts%, starting at 1
Variable Set String %dir% to "C:\foo\bar\"
...
Text Type (Simulate Keystrokes): %dir%%parts[1]%_LE.txt

Yours, of course, is more elegant.

 

Kindly,

Mark

Link to comment
Share on other sites

  • 2 weeks later...

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...