You are not logged in.
When I try the pdf renaming PascalScript, ReNamer gives this error:
Preview process has been terminated due to a critical error:
Pascal Script Execute:
[Line 13] Exception: Access violation
I updated the file to the latest beta (dated 26-3-2019), but I get the same error.
Earlier the same script worked well.
(I have placed the pdfinfo.exe in the same folder as ReNamer.exe file.)
Offline
Since the forum has multiple versions of the pdf name script, I am reproducing my script below:
{ Extract PDF tag }
const
PDF_INFO = 'pdfinfo.exe';
PDF_TAG = 'Title';
function ExtractTagPDF(const Info, Tag: string): string;
var
Lines: TStringsArray;
I, Delim: Integer;
begin
Result := '';
Lines := WideSplitString(Info, #13#10);
for I := 0 to Length(Lines)-1 do
if WideSameText(Tag, Copy(Lines[i], 1, Length(Tag))) then
begin
Delim := WidePos(':', Lines[i]);
if Delim > 0 then
begin
Result := WideCopy(Lines[i], Delim+1, WideLength(Lines[i]));
Result := Trim(Result);
end;
end;
end;
var
Command, Output: string;
TagValue: string;
begin
Command := '"'+PDF_INFO+'" "'+FilePath+'"';
ExecConsoleApp(Command, Output);
TagValue := ExtractTagPDF(Output, PDF_TAG);
FileName := TagValue + WideExtractFileExt(FileName);
end.
Offline
Line#13 seems to be this: Lines := WideSplitString(Info, #13#10);
Offline
Lines: TStringsArray;
Lines := WideSplitString(...);
Do you see the error?
If not, see the list of functions:
http://www.den4b.com/wiki/ReNamer:Pasca … :Functions
I will take a look later on if you got it ;-)
Read the *WIKI* for HELP + MANUAL + Tips&Tricks.
If ReNamer had helped you, please *DONATE* to Denis or buy a PRO license. (Read *Lite vs Pro*)
Offline
Thanks for reporting.
It appears to be a significant interoperability issue between the newer compiler (FPC 3) and the scripting engine (Pascal Script).
This issue seems to affect all pascal script functions which return dynamic arrays, such as WideSplitString.
The investigation continues...
Offline
Hi
Is there a workaround for this issue? IMHO reverting to older version is fine as long as it works.
With the latest issue, we cannot use Pascalscript for pdf-renaming at all.
My collection of downloaded pdf files is increasing day-by-day, so this is a major issue for me!
Offline
Is there a workaround for this issue?
Yes, there is, and it is already available in ReNamer v7.0.0.4 Beta
Offline