Jump to content
Macro Express Forums

Rename Files


Alnaz
 Share

Recommended Posts

I like taking screenshots with Fraps. I have them saved to a folder on my desktop called Screenshots. They are saved with a long name that is the date they were created. I would like to rename all the screenshots in the folder consecutively starting with 01 and keeping the same extension .bmp. The rename may stay in the same folder. If anyone can post some code that I could copy and paste to help me get started would be appreciated.

Link to comment
Share on other sites

  • 2 weeks later...

Another option, of course, is to simply use Macro Express. Here is a sample macro that renames files in my c:\xtemp folder to a sequence beginning with 0001.bmp and displays each change in Notepad. You will need to change it to suit your specific requirements (folder and sequence range). And it wouldn't hurt to test it on a dummy folder either.

 

Window Minimize: "Macro Express - "
Activate or Launch: "notepad" OR "notepad.exe"

Variable Set Integer %N1% to 1000
Change Directory/Folder: "c:\xtemp"

Repeat with Folder
 Variable Modify Integer: Inc (%N1%)
 Variable Modify Integer: Convert %N1% to text string %T2%
 Variable Modify String: Delete Part of %T2%
 
 Activate Window: "notepad"
 Text Type: %T1%   -->>   %T2%.bmp<ENTER>
 
 Rename File or Files: "%T1%"
 Delay 250 Milliseconds
Repeat End
Macro Stop


<WMIN:Macro Express - ><LAUNCHYES3:0:0112notepad<LAUNCH:notepad.exe><REM2:><IVAR2:01:01:1000><DOFILE:01:NN:c:\xtemp>><REM2:><REP3:07:000001:000001:0001:0:01:c:\xtemp><NMVAR:08:01:0:0000001:0:0000000><NMVAR:05:01:0:0000002:0:0000000><TMVAR2:11:02:00:001:001:><REM2:><ACTIVATE2:notepad><TEXTTYPE:%T1%   -->>   %T2%.bmp<ENTER>><REM2:><DOFILE:06:NN:%T1%>%T2%.bmp><MSD:250><ENDREP><MSTOP>

Link to comment
Share on other sites

I want to thank everyone who posted to my question, I viewed everyones link, which was interesting but had too many options.

 

Joe, you made one in Macro Express, I copied & pasted your code and it worked perfectly the first time, I'm totally impressed. You even added a notepad that automatically opens up and shows the before and after nameing, what more could I ask for.

Now when I copy my screen shots to edit in Adobe PhotoShop Elements, I can see all of the name listed under the thumbnail image verses a very long time stamp which doesn't show all cause its too long and it is too confusing. This code is exactly what I was looking for. Thanks :)

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