forked from jpscharf/ScriptMaster-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSaveFileDialog.groovy
More file actions
38 lines (30 loc) · 853 Bytes
/
SaveFileDialog.groovy
File metadata and controls
38 lines (30 loc) · 853 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
Purpose: Asks a user for a save location and filename.
Returns: File Path
Name: SaveFileDialog ( saveTitle ; defaultDirectory ; defaultFileName )
Parameters: ( saveTitle ) text
( defaultDirectory ) filepath
( defaultFileName ) text
Dependencies: NONE
2011-09-01 JPS, Created.
NOTES:
NONE
*/
import java.awt.*;
import javax.swing.JOptionPane;
System.gc();
String title = saveTitle;
FileDialog saveDialog = new FileDialog(JOptionPane.getRootFrame(),title, FileDialog.SAVE);
saveDialog.setDirectory(defaultDirectory);
saveDialog.setFile(defaultFileName);
saveDialog.show();
if (saveDialog.getFile() != null) {
selectedFile = fmpro.convertPathToFileMaker(saveDialog.getDirectory() + saveDialog.getFile())
saveDialog = null;
System.gc();
return selectedFile;
} else {
saveDialog = null;
System.gc();
return false;
}