application.writeTXTfile question

Questions, tips and tricks and techniques for scripting in Servoy

application.writeTXTfile question

Postby pbakker » Fri Feb 06, 2004 8:45 pm

Hi,

I noticed that if you do not specify a filename in this function, on windows you get a (Windows??) Save dialog. Is it possible to have the option to specify a "Suggestion Filename" and let the "Windows" Save Dialog appear with the Sggested Filename in the FileName area of the Save Dialog?? This way the user can change the location and filename, or can just press "Save" in the Save Dialog.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby IT2Be » Fri Feb 06, 2004 9:11 pm

You can use the following to define the name first:

var p = plugins.file.showFileOpenDialog()

and use the result like p.getAbsolutePath()...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby pbakker » Fri Feb 06, 2004 11:38 pm

Marcel, with this option (that does offer new some new ideas... :-) ) i run into the same issue:

In the area where the user can put the filename, I want to make a suggestion, for example: CustomerReport_06-02-2004.txt. The user can then override it, or just click "save".

That is the other thing about this option: It says "Open". To not confuse the user, it should say "Save"

Servoyians: Any chance of adding these features?

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby IT2Be » Fri Feb 06, 2004 11:43 pm

Sorry, my mistake. You should use:

Code: Select all
application.showFileSaveDialog( [fileName suggestion])
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby pbakker » Sat Feb 07, 2004 11:03 am

:D

Yep, that does it!

I never looked there. Doesn't it make more sence to have this function under the file plugin node in the method editor?

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands


Return to Methods

Who is online

Users browsing this forum: Bing [Bot] and 28 guests

cron