Saving/exporting a file to a user specified directory from a pop-up window

Hello,

I am having trouble finding out how to safe or export a file to a directory that a user will chose from a pop-up window.
these are the steps:

-ask the user what folder he/she wants to save the file to
-use the path the user has chosen to save or export the .fbx or .clip to the specified directory

FBApplication has FileSave but that saves it in the same directory as the file I am saving/exporting the information from.
in MoBu 2012 there is no .SaveBegin( r’path’ ), do you know another way to do it? In the documentation it says that FBApplication has taken on all the .Save functions, but it has no …SaveAs.

So you have the path you want to save to already, just no way to save the file there?

in 2011 i have no problems just using FileSave and specifying the whole path (‘C:/testing.fbx’)

Yes, I have a path, that I get from the user- a file destination- I just want to export the .fbx there.
the way i do it seems to be faulty, for example i have:
path=“c:\program files”
name=“exported.fbx”
lApplication.FileSave(path + name)

it exports: on c:\ the file program filesexported.fbx
if i leave the path and just use name, it exports it in the same directoy
and if i leave out the name, well…it exports program files.fbx
i just need a “” inserted somehow there and it should be fine. :slight_smile: Any ideas?

Solution: lApplication.FileSave(path + “\” + name)
^^ fun times

A better way to concatenate strings for a path is to use to os.path.join() function, like so:


import os.path

...

lApplication.FileSave(os.path.join(path, name))

How very elegant h6x6n. Thank you!
That was exactly what I was looking for. The version I used works, but it feels like a workaround, I do prefer the one you posted. :slight_smile: