Hi guys, maxscript beginner here,
I have a small dialog Ive created with a hyperlink. The purpose of the hyperlink is for the user to quickly access a help file. Currently I have the example below working. The issue is, that the hyperlink does not open the .docx file unless I close and re-run the maxscript.
Im thinking I may be using sysInfo.currentdir incorrectly here. Or just the wrong method in general. Not sure. If anybody could shed some light on this, it would be appreciated.Thanks!
--Example:
try(closerolloutfloater rof) catch()
global docPath = sysInfo.currentdir + "/help.docx"
rollout a "Help"(
group "Help" (
HyperLink Hypl_homepage "Help File" align:#center width:75 height:15 address:docPath color:(color 0 0 255) hovercolor:(color 255 255 0) visitedcolor:(color 255 0 255)
)--end group
)--end rollout a
Replies
Again, when I first open max, it looks for a totally different file. When I close the script and re-run it, then it works fine. Any ideas?
(
openScript = sysInfo.currentdir + "\\myTools.ms"
filein (openScript)
)
I am not sure about what you are trying to achieve, but I wouldn't use the sysInfo structure for any path composition in Max. Furthermore I believe the "currentDir" doesn't define a unique path.
Have a look at following topics in the MaxScript Reference:
- "GetDir" under "3ds Max System Directories"
- "getThisScriptFilename" under "MAXScript Source Filename Access"
- "File Name Parsing"
- "Symbolic Pathnames"
They should provide all you need.
Cheers