Jump to content
Macro Express Forums

Trying to rename list of files in ME3.9a/Win8.1


BBO

Recommended Posts

Running ME 3.9a and just up(down?)graded to Windows 8.1 from XP

 

Self-taught, so i am assuming this is a klugy way to do this, but i need to rename a list of files. Everything worked great in XP, then had to move to 8.1

 

The problem is the XP versions of rename a file (Alt-F, then M), now translated to 8.1 (Alt-H, then R) don’t seem to grab the filename so i can copy it into the clipboard.

 

I run this from the DETAILS view of a folder.

I'll make a decision about how many of the files to do in the list based on the names, or dates modified, or whatever.

I highlight the first file in the list that i want to rename, then start the macro.

In the Repeat Prompt command, tell ME how many files i want to rename.

It just runs down the list of files in DETAILS view.

 

 

Currently doing this:

 

Clear All Variables: All

Clipboard Empty

Variable Set String %T6% from Window Title

Activate Window: "%T6%"

 

Repeat Prompt Start (Prompt for repeat count at macro play time)

Activate Window: "%T6%"

Wait For Window Title: "%T6%"

Text Type: <ALT><ALT>H

Delay 50 Milliseconds

Text Type: R

Delay 50 Milliseconds

Clipboard Copy

Variable Set String %T3% from Clipboard

 

 

....At this point i do a lot of file name manipulation based on the current filename that is in Clipboard (and %T3%). The new filename is placed in %T7%

 

 

// Write new file name

Text Type: <DELETE>

Delay 50 Milliseconds

Text Type: %T7%

Text Type: <ENTER>

Delay 200 Milliseconds

If Not Window Title "%T6%" on top

Text Box Display: Variables

Text Type: N<ENTER>

End If

Wait For Window Title: "%T6%"

Repeat End

Audio Unmute

 

 

I feel like there’s a much simpler way to do this, but the macro has organically grown into this based on what worked, and my ignorance of what ME commands might be more efficient for this.

 

I know there’s a “Rename Files or Folders” command, but i need to get the filename into a variable so i can make decisions about how to rename it based on the current filename. (Hence the Alt-H and R commands).

 

I feel stupid, but i can’t seem to find any other way in ME to get the current filename into a variable. All the ME commands seem to want the filename as an input, but my filenames change as the macro goes down the list of files.

 

Any help making this more efficient or robust would be appreciated.

Link to comment
Share on other sites

Are these files in one or only a few folders? If so, I would use the Repeat with Folder command. Something like this may get you started:

// Get Path to My Documents
Set Variable %T1% to "Path to My Documents"
Change Directory/Folder: "%T1%"

// Rename each file in the folder, one at a time
Repeat with Folder
  Variable Set From File Path
  Rename File or Files: "%T2%"
Repeat End

Copy this code and paste it into your macro:

<REM2:Get Path to My Documents><VSETMISC:T1:Path to My Documents><DOFILE:01:NN:%T1%>><REM2:><REM2:Rename each file in the folder, one at a time><REP3:07:000001:000001:0002:0:01:%T1%><VFFILE:1:T:10:T:11:T:12:T:13:%T2%><DOFILE:06:NN:%T2%>%T12%%T13%><ENDREP>
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...