The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Exporting Multiple files with Prompt

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
rmtruji Posted - 04/24/2002 : 5:21:20 PM
I am wondering if anyone can help me with this issue. I have used the following code to export multiple graphs at one time and it works just great:

*********
document -e p {
getnamedwin %h; //activates one graph
run.section (File,Init);
%b="C:\My Documents\My Pictures\";
image.FileName$=%b%h.emf;
image.ShowOptions=0;
image.export.pageDPI(EMF,300,24,2); };
************
The problem is that I don't want to hardcode the pathname to where I want to put the files. I would like the script to prompt me and ask where I want to put the files. I found the following code for the prompting of saving files:

**************
FDlog.CheckName$=$DialogBox.ExportImage;
FDlog.CheckStatus=Image.ShowOptions;
FDLOG.default$=%H;
FDlog.UseGroup(Image);
Image.GetExtList(z,e);
FDlog.UseType(%z);
if(FDlog.SaveAs(a))
return 1;
Image.ShowOptions=FDlog.CheckStatus;
%z=FDlog.DefTypeExt$;
%B=FDLOG.path$;
Image.FileName$=%b%a;
if(image.IsVector(%Z))`
type -M GraphExportCheckPageSettings;
ImgExperr = Image.Export.PageDPI(%z);
if(ImgExperr > 1) // 1 == user canceled
type -a "Error! Image Export failed, err = $(ImgExperr).";
del -v ImgExperr;
return 0;
*************************
When it prompts, it doesn't allow me to put *.* in the "File Name" section to save all files. It will only save one file at a time. Is there a way to merge these two groups of code so that I can export multiple graphs and have it prompt me to where I want to put them?

Thanks.
3   L A T E S T    R E P L I E S    (Newest First)
CStorey Posted - 04/26/2002 : 11:51:28 AM
Hi Steve,

The following works with Origin 6.1 SR4. Origin implemented a new FDLOG function for the purpose of selecting just a directory.

%Z=""; // You could use %Z=some default starting location.
FDLog.DlgName$="Select destination directory for graphs.";
FDLog.ShowComment=1;
FDlog.path$="%Z";

If(FDLog.OpenPath(Z)!=0/0)
{
document -e p {
getnamedwin %h; //activates one graph
run.section (File,Init);
image.FileName$=%Z%h.emf;
image.ShowOptions=0;
image.export.pageDPI(EMF,300,24,2); };
};
Return;


Craig Storey
Origin WebRing Member - http://g.webring.com/hub?ring=originwebring
eparent Posted - 04/26/2002 : 10:37:00 AM
It sounds like you just want a prompt for a path. Below is your original code modified to prompt for a target path.


i=FDlog.OpenPath(b);
if( i == 0 )
{
document -e p {
getnamedwin %h; //activates one graph
//run.section (File,Init);
//%b="C:\My Documents\My Pictures\";
image.FileName$=%b%h.emf;
image.ShowOptions=0;
image.export.pageDPI(EMF,300,24,2); };
}


I hope this helps. For more information on using LabTalk's FDlog object see your Origin LabTalk manual.




Edited by - eparent on 04/26/2002 10:44:45
Jose Posted - 04/25/2002 : 10:10:19 AM
You almost had it! You can improve this, but the following code worked fine:


FDlog.CheckName$=$DialogBox.ExportImage;
FDlog.CheckStatus=Image.ShowOptions;
FDLOG.default$=%H;

FDlog.UseGroup(Image);
Image.GetExtList(z,e);
FDlog.UseType(%z);
if(FDlog.SaveAs(a)) return 1;

%t=FDlog.DefTypeExt$;
%B=FDLOG.path$;


document -e p {
getnamedwin %h; //activates one graph
run.section (File,Init);
image.FileName$=%b%h.%t;
image.ShowOptions=0;
image.export.pageDPI(%t,300,24,2); };


When the file name is asked don't pay much attention to it and leave the default one: just select the destination folder and the file extension, that will determine the final image type.



Jose Viņa, Origin WebRing member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000