For OneDrive/SharePoint, folders with the name "_vti" are not allowed due to the history of Front Page Extensions and whatnot. Anyway, I'm backing up a bunch of old stuff to OneDrive and it won't sync those folders. No problem, I see PascalScript seems to be able to handle this. I wrote a simple script, but I am not well versed in PascalScript and I'm getting a type mismatch error. I tried a lot of different things, like utf8encode/decode and stuff, no luck. Can somebody help?
function OnReplaceFilenameLeftToRight(const FileName: UnicodeString;
const isFolder: Boolean):UnicodeString;
begin
if isFolder and FileName = '_vti' then
Result := 'RENAMED_vti'
else begin
Result := FileName
end;
end;
function OnReplaceFilenameRightToLeft(const FileName: UnicodeString;
const isFolder: Boolean):UnicodeString;
begin
if isFolder and FileName = 'RENAMED_vti' then
Result := '_vti'
else begin
Result := FileName
end;
end;
Folder rename using PascalScript
Re: Folder rename using PascalScript
Hi,
all you need is some parentheses:
all you need is some parentheses:
Code: Select all
function OnReplaceFilenameLeftToRight(const FileName: UnicodeString;
const isFolder: Boolean):UnicodeString;
begin
if isFolder and (FileName = '_vti') then
Result := 'RENAMED_vti'
else begin
Result := FileName
end;
end;
function OnReplaceFilenameRightToLeft(const FileName: UnicodeString;
const isFolder: Boolean):UnicodeString;
begin
if isFolder and (FileName = 'RENAMED_vti') then
Result := '_vti'
else begin
Result := FileName
end;
end;