Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Below is a PascalScript code for <a href="http://www.den4b.com/?x=products&amp;product=renamer" rel="nofollow">ReNamer</a> which will create a <em>Readme.txt</em> file in every processed folder.</p> <p>The script is executed during the preview, so for safety it will ask you whether to create <em>Readme.txt</em> or not every time you preview. This script uses <code>ReadmeText</code> constant for the content, but it could also be made that it copies the content of <em>Readme.txt</em> file from a file on your system. It will only create a <em>Readme.txt</em> file if one does not already exist. Drop all your folders into ReNamer and use this script. </p> <pre><code>const ReadmeName = 'Readme.txt'; ReadmeText = 'Content of Readme file goes here!'; var Initialized: Boolean; ReadmePath: WideString; DoCreateReadmeFile: Boolean; begin if not Initialized then begin Initialized := True; DoCreateReadmeFile := DialogYesNo('Create Readme file this time?'); end; if WideDirectoryExists(FilePath) then ReadmePath := WideIncludeTrailingPathDelimiter(FilePath) else ReadmePath := WideExtractFilePath(FilePath); ReadmePath := ReadmePath + ReadmeName; if DoCreateReadmeFile and not WideFileExists(ReadmePath) then FileWriteContent(ReadmePath, ReadmeText); end. </code></pre> <h2>Edit</h2> <p>Script below will take a source file defined by <code>SourceFilePath</code> and copy it to the target folders. It will also warn you if source file does not exist.</p> <pre><code>const TargetFileName = 'Readme.txt'; SourceFilePath = 'C:\Temp\Readme.txt'; var Initialized: Boolean; TargetFilePath: WideString; DoCreateFiles: Boolean; begin if not Initialized then begin Initialized := True; if WideFileExists(SourceFilePath) then DoCreateFiles := WideDialogYesNo('Create "'+TargetFileName+'" files this time?') else WideShowMessage('Source file does not exist!'+#13#13+SourceFilePath); end; if WideDirectoryExists(FilePath) then TargetFilePath := WideIncludeTrailingPathDelimiter(FilePath) else TargetFilePath := WideExtractFilePath(FilePath); TargetFilePath := TargetFilePath + TargetFileName; if DoCreateFiles and not WideFileExists(TargetFilePath) then WideCopyFile(SourceFilePath, TargetFilePath, False); end. </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload