This function attempts to determine the file path of the currently executing R script. It works across multiple contexts: - In RStudio: returns the path of the active source editor tab. - In Rscript: extracts the `–file` argument used in script execution. - When sourced: uses the internal `ofile` value.