Skip to content

GetRelTargetPath()

ts
GetRelTargetPath(): string;

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

NOTE

Only copy, rename, or move operations have a source and a target path. For example, if you move file /docs/resume.pdf to /archive/oldresume.pdf, the target path is /archive/oldresume.pdf.

Example

ts
{
  if (Session) {
    // Let's say the last file operation was a move of a file from `/docs/resume.pdf`
    // to `/archive/oldresume.pdf`, then...
    var rtp = Session.GetRelTargetPath();
    Log(rtp); // Will log `/archive/oldresume.pdf`
  } else {
    Log('Session object is not available.');
  }
}