Skip to content

Instantly share code, notes, and snippets.

@yanek
Created May 8, 2017 10:13
Show Gist options
  • Save yanek/25c985936ba07a8ed9d544d34a90a5e2 to your computer and use it in GitHub Desktop.
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 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.
@hl2guide
Copy link

hl2guide commented Aug 9, 2023

thanks for making this 👍 ⭐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment