Skip to content

GetAbsPath() ​

ts
GetAbsPath(): string;

Returns the absolute 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 current VFS is of type `Disk` and has its root in `C:\SFTPData`
    // and the last file operation occurred on file `/docs/resume.pdf`
    var ap = Session.GetAbsPath();
    Log(ap); // Will log `C:\SFTPData\docs\resume.pdf`
  } else {
    Log('Session object is not available.');
  }
}