How do I create a button from a Renaming Script

Hello,

I have this Sequence Number script that is used in Rename script mode, but I want to make this script into a button.

How do I do this? :question:

@script vbscript
Option Explicit
DIM intSeqNum
intseqnum = "1"

Function Rename_GetNewName ( strFileName, strFilePath, _
fIsFolder, strOldName, ByRef strNewName )
' Add script code here

'1. Get substring before hat and after hat
'2. generate sequence number starting from 1
'3. assign substrings and sequence number to new file name

DIM strbeforeHat, strafterhat

strbeforehat = mid(strfilename, 1, instRrev(strfilename, " ^")-1)
strafterhat = Mid(strfilename, instRrev(strfilename, " ^"))
strnewname = strbeforehat & " " & intseqnum & strafterhat
intseqnum = intseqnum + 1

End Function

Have a look at this thread from earlier today.

There are also a few examples in the Rename Scripting and Buttons forums if you need more, but the basic structure is in the thread I linked above.