Jump to content
Macro Express Forums

Rename File Using Date/time


Recommended Posts

Hello, I have a PVR application that creates a fixed name of 'capture.mpg'

Everytime I want to perform a new capture, I first have to manually rename the captured file.


I would like to have a macro that does this automatically.


eg. If I have a macro that activates the stop button of my record application, it checks to see if a file called 'capture.mpg' exists, and if so renames it to something more meaningful like the current time/date.mpg


I found the text command 'Date/Time' which saves the current time into a variable. (eg T1)


What I want to know is can I use this variable in combination with a rename function?



Link to comment
Share on other sites

Hello Dean!


Using the Date/Time command, store a formatted date/time string to a variable, say T1, and then use it in the Rename File or Files command. Like this:

If File Exists "capture.mpg"
 Date/Time: Save "yyyy.mm.dd hh.mm" into %T1%
 Rename File or Files: "capture.mpg"
End If

<IFOTH:01:2:c:\temp\capture.mpg><DT:yyyy.mm.dd hh.mmT:01:1:><DOFILE:06:NN:c:\temp\capture.mpg>c:\temp\%T1%.mpg><ENDIF>

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.

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.

  • Create New...