qiuqiu
1
The path object adds a method or property to obtain the absolute path, which can return the absolute path of the path.
The path object cannot correctly return the path containing system variables, for example:
DOpus.FSUtil.NewPath("%temp%\test.txt") 'reutrun %temp%\test.txt
DOpus.FSUtil.NewPath("%temp%\..\test.txt") 'reutrun %temp%\..\test.txt
Expected value
C:\Users\qiuqiu\AppData\Local\Temp\text.txt
C:\Users\qiuqiu\AppData\Local\text.txt
Leo
2
Try the FSUtil.Resolve function
qiuqiu
3
I just saw this method, but it can only resolve system variables, not relative paths
strFileName = "%temp%\..\text.txt"
dopus.output DOpus.FSUtil.resolve(strfilename)
output
C:\Users\qiuqiu\AppData\Local\Temp\..\text.txt
Leo
4
You can use GetAbsolutePathName for that. A quick forum search shows you're already using it in some of your other scripts.