I didn't understand how to get the file path before. For saved ones it is "%FILE", for unsaved ones it is "%TEMPFILE". If I use "%FILE", the tool does not work with unsaved file. I've now figured out that you have to use both parameters at the same time: "%FILE" "%TEMPFILE".
This code polls all parameters until it finds an existing path.
Code: Select all
Count = CountProgramParameters()
For i = 1 To Count
tmp$ = ProgramParameter()
If Asc(tmp$) And FileSize(tmp$) > 3 And Left(GetExtensionPart(tmp$), 2) = "pb"
Break
EndIf
Next
I've added this code to all my tools: "alignment_of_comments", CodeLocalization, CommentLocalization, FindAllReferences (Linux), Include_Helper, no_comment, pb2html, Tidy. Who has encountered the problem, then update these plugins.