Skip to content

GetRelPath() ​

ts
GetRelPath(): string;

Returns the relative VFS-root-based path of the last file operation as pointed to by the current VFS.

WARNING

This method reflects the session's live current-cursor state, which may have changed by the time your script reads it. If you need the path of the file that triggered the current event, use CtxRelPath() instead.

Example ​

ts
{
  if (Session) {
    // Let's say the last file operation occurred on file `/docs/resume.pdf`
    var rp = Session.GetRelPath();
    Log(rp); // Will log `/docs/resume.pdf`
  } else {
    Log('Session object is not available.');
  }
}