Created
May 8, 2017 10:13
-
-
Save yanek/25c985936ba07a8ed9d544d34a90a5e2 to your computer and use it in GitHub Desktop.
FO4Edit script to prepend any string to the FULL - Name field of every selected records (useful for sorting mods patching)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
This script will prepend supplied value to the Full Name field | |
of every selected record. | |
} | |
unit UserScript; | |
var | |
s: string; | |
function Initialize: integer; | |
var | |
i: integer; | |
begin | |
Result := 0; | |
// ask for string | |
if not InputQuery('Enter', 'Prefix', s) then begin | |
Result := 1; | |
Exit; | |
end; | |
// empty string - do nothing | |
if s = '' then | |
Result := 2; | |
end; | |
function Process(e: IInterface): integer; | |
var | |
elFullName: IInterface; | |
begin | |
Result := 0; | |
elFullName := ElementByName(e, 'FULL - Name'); | |
if Assigned(elFullName) then begin | |
SetEditValue(elFullName, s + ' ' + GetEditValue(elFullName)) | |
end; | |
end; | |
end. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks for making this 👍 ⭐