Home Technical Talk

maxscript - opening local files

Hi guys, maxscript beginner here,

I have a small dialog I’ve 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.
I’m 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

  • theStudent
    Here's another thing I'm trying with the same sysInfo.currentDir.
    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)
    )
  • SyncViewS
    Offline / Send Message
    SyncViewS polycounter lvl 13
    Hi,
    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
  • theStudent
    Thank you for your feedback! I'm looking through them now. I think getFileNamePath might be what I'm looking for under one of your suggestions, "File Name Parsing". Testing it out now =]
Sign In or Register to comment.