RL Vision Knowledge Base

Support questions and answers for software by RL Vision.

Note: This is an archived discussion. Any bug, problem or suggestion mentioned here is likely to have been fixed since it was written.

Subject: Re: scripts

Date: Tue, 03 Mar 2009 18:38:03 +0100


I have included the script in this letter. It should normally be placed in this folder:

C:\Documents and Settings\All Users\Application Data\RL Vision\Flash Renamer\Script

The easiest way to reach it is to start Flash Renamer and go to the script function. Here, click on the "edit" button to open the selected script in notepad.

If you make a useful script then you are welcome to send it to me and I might distribute it with future versions of Flash Renamer!

// Dan

Bozidar wrote:
> Hi!
> I have found 'Flash Renamer' program on Internet and seems quite good.
> But, I can't find file 'Example - Base for New Script.frs' which should be distributed with program.
> Is it possible to send me? Any further script or documentation about scripting will be welcome.
> Thank you in advance!
> Cheers!
> Bozidar

description=This example is a good start when creating a new script! Press the edit button to see the script source together with instructions on how to continue!

' - EXAMPLE BASE SCRIPT -------------------------------------------------------------------------
' This script does not do anything, but it includes a basic
' structure and example code that is a good start when
' creating a new Flash Renamer script.
' The first thing you want to do is to save this file as a new
' filename in the same folder. Make sure that it gets an ".frs"
' file extension (since Notepad tends to add .txt to files...)
' This script is written in the VB Script programming language.
' If you create a useful script, send it to me and I might include
' it in the next version of Flash Renamer!
' Flash Renamer exposes parameters and functions though the read-only
' object "FlashRenamer". The following are available at the moment:
' FlashRenamer.Filename - This is the string that Flash Renamer wants you to process. Note that it depends on the "Process Name" and "Process Extension" settings in Flash Renamer.
' FlashRenamer.FullFilename - This always contains the full filename, including extension, in contrast to the above. Use it for reference.
' FlashRenamer.Path - This is simply the path where the file is located.
' FlashRenamer.Args - The arguments you can enter when you run a script in Flash Renamer are delivered through this variable.
' FlashRenamer.FormatTags(myTags) - This is a function you can call to "render" a format string, just like format strings in Flash Renamer. For example, FlashRenamer.FormatTags("") will return the size of the file!
' FlashRenamer.Preview - This is a boolean value (true or false) that tells you if your script is being run to generate the preview or if it is the "real deal".
' FlashRenamer.DiskName - When runing presets, multiple functions process the filename before writing it to disk. Since the filename may have been changed previous to entering your script, you should use .DiskName if you want to access the file on disk.
' FlashRenamer.NumItems - This always contains to total amount of files that are destined to be renamed
' FlashRenamer.ItemOrder - This contains a zero padded id repressenting the order in which this item is located, relative to the rest of the items.
' FlashRenamer.BrowserPath - This contains the path that is currently loaded in the file browser in Flash Renamer. If using free select mode, this is empty.
' Now, let the coding begin :-)

'- Global variables -----------------------------------------------------------------------------

Dim iNumFiles ' You can define global variables like this. These will be available to all function, and are static so they keep their value for the entire rename session. (A session starts when you press the rename button or a new preview is performed)

'- Init function --------------------------------------------------------------------------------

Function Init() 'The Init function runs first of all, before anything else.

iNumFiles = 0 'this is a good place to init the global variable

End Function

'- Rename function ------------------------------------------------------------------------------

Function Rename() 'Flash Renamer will call the Rename function for each file to rename.

If FlashRenamer.Preview = True then

iNumFiles = iNumFiles + 1

'Use the FormatTags function to get the size of the file currently being renamed
s = FlashRenamer.FormatTags("")

'This is how you send the new filename back to Flash Renamer:
Rename = "File " & iNumFiles & " is " & s

End if

End Function

'- Done function --------------------------------------------------------------------------------

Function Done() 'When all files have been renamed, this functions is called.

'send a message to the user
If FlashRenamer.Preview = False then MsgBox("This is an example script and it does not rename your files...")

End Function

'- Other functions ------------------------------------------------------------------------------

Function MyFunc( MyArg ) 'You can add your own functions like this

MyFunc = "You sent " & MyArg & "as argument to this function!"

End Function

Example - Base for New Script.frs

Back to Knowledge Base

 · Software
 · Download
 · Order

 RL Vision
 · About
 · Contact
 · News
 · Blog

 · Flash Renamer
 · PDF Img Extract
 · Exif Tag Remover
 · Dupli Find

 · Replace Genius
 · Office Img Extract
 · Notepad2 BE
 · PhotoSift
 · CCTime
 · Hot Spot Studio
 · Snap2HTML
 · Snap2IMG
 · Bubble Math
 · DinnerWiz
 · NSF Tool
 · Beep.Exe

 · Changelogs
 · TitleQ
 · ArtGem
 · Graphics Tutorials
 · Win7 Font Bug
 · KB

Like my Freeware?

I'm on GitHub too!

© 1998-2023 RL Vision Privacy Policy