GetAbsTargetPath()
ts
GetAbsTargetPath(): string;Returns the absolute path of the target file in the last file operation as pointed to by the current VFS. Returns a non-empty string only within event-handlers that move or rename files or directories.
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 CtxRelTargetPath() instead.
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 current VFS is of type `Disk` and has its root in `C:\SFTPData`
// and the last file operation was a move of a file from `/docs/resume.pdf`
// to `/archive/oldresume.pdf`, then...
var atp = Session.GetAbsTargetPath();
Log(atp); // Will log `C:\SFTPData\archive\oldresume.pdf`
} else {
Log('Session object is not available.');
}
}