ScriptSpot

Forum topic · General Scripting

get path to selected file

By br0t · 2010-12-29

Description

Hi,
there is the "getSavePath" in Max, that lets you browse to a folder and will return that path, so it can be used to save or open files in that folder. I would like to have the same thing, but not for folders but files. So that a dialog appears and the user can pick e.g. a material library file. The path to that file would than be returned and could be used to open and edit that material library afterwards. The "getOpenFileName" command shows what I want to do, but it only works for saving Max files.

So how can I browse to a file and get that path?

Regards

Comments (4)

Graph · 2010-12-30

it doesnt save anything it just gets a filePath and displays the "save" texts instead of "open"

br0t · 2010-12-30

True...we are almost chatting right now lol :D

Aww man :D Yeah I did find

br0t · 2010-12-30

Phew, I don't know what went wrong yesterday, but I even have that command in my post above... getOpenFileName does exactly what I want, I guess I mixed up something. Thanks (I feel dumb now...) :P

Graph · 2010-12-30

getOpenfileName
getsaveFIlename

arent those functions in the same page of the help?!