getOpenFileName and getSaveFileName

Next
 From:  pressure (PEER)
11078.1 
Hi Michael,

Is there a way to set the initial directory when doing moi.filesystem.getOpenFileName() and moi.filesystem.getSaveFileName()? I'm trying set something up where the initial directory for open is persisted separately from that for save like for when I'm interactively opening STEP files from one directory and saving 3DM's out to a different directory.

- Peer
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
11078.2 In reply to 11078.1 
Hi peer, yes moi.filesystem.getOpenFileName() and moi.filesystem.getSaveFileName() each can take 3 function arguments:

Arg 0 - required - string for dialog title
Arg 1 - required - string for file extension filters:
// The filter string has entries separated by the pipe | character, with
// the entries in pairs with a label first and then a filter next, for example:
// 'Point files (*.txt, *.xyz, *.csv)|*.txt;*.xyz;*.csv|All files (*.*)|*.*'

Arg2 - optional - string for filename to initialize with.


You should be able to send in a directory path for the initialize filename arg.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  pressure (PEER)
11078.3 In reply to 11078.2 
Sweet! Thanks for documenting the optional 3rd parameter Michael and for making it an option in the first place.

- Peer
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All