Sign in to follow this  
Followers 0
Jury

re-set default save to directory

6 posts in this topic

All,

I've been looking at and experimenting with variations of FileSaveDialog trying to find a way to re-set the default directory. I have a program that works okay up to when it prompts me to save the file being downloaded - this server side generated FileSaveDialog always automatically saves to the last directory I've saved something to (is that correct?). Is there some way of, at the start of my program, re-setting this default directory to something like @MyDocumentsDir ? Or is FileSaveDialog the complete wrong way to go?

Thanking you,

Jury

Share this post


Link to post
Share on other sites



FileSaveDialog() lets you define its 'init dir'. See its entry in the Helpfile for more info.

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

But the FileSaveDialog isn't of my making it comes about from the server response to my request. I have tried to run a FileOpeneDialog and FileSaveDialog using the required directory hoping this would re-set the default directory before making my request but this doesn't seem to change the default directory.

Edited by Jury

Share this post


Link to post
Share on other sites

But the FileSaveDialog isn't of my making it comes about from the server response to my request. I have tried to run a FileOpeneDialog and FileSaveDialog using the required directory hoping this would re-set the default directory before making my request but this doesn't seem to change the default directory.

What is the method your are using to make your "request" against the server?

Share this post


Link to post
Share on other sites

What is the method your are using to make your "request" against the server?

The code below sends my file to be processed to the server then the server responds with the standard FileSaveDialog panel for the file which now has been processed by a server side program. One would normally then choose the directory and fill in a file name but to automate so it always saves to the directory I want to save it to I was hoping to be able to set that directory some way - otherwise it just saves to the last directory I saved something to (I think that last directory saved to becomes the default directory in windows). Everything works except insuring the directory where the file is save to is always the same.

Jury

$ICLRfound = @MyDocumentsDir & "\temp.tmp"
$oIE = _IECreate("http://www.---")
$oForm = _IEGetObjByName($oIE, "infile")
_IEAction($oForm, "focus")
Sleep(5000) ;five seconds
Send($ICLRscratch)

Share this post


Link to post
Share on other sites

I guess you could use the AUInfo tool to identify control_ids on the SaveAs Dialog box and have the script interact with it.

Does the form automatically run after the infile control has updated? Most html forms use a POST method, you might be able to do something with the POST URL instead.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0