Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\{table:class=servoy sReturnTypes}{tr:style=height: 30px;}{th}Return Types{th}{tr}{tr}{td}{span:class=sWordList}[JSFile]{span}{td}{tr}{table}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[JSFile]{td}{td}[#convertToJSFile]\(file)
Returns a JSFile instance corresponding to an alternative representation of a file (for example a string).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#copyFile]\(sourceFile, destinationFile)
Copies the sourcefile to the destination file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#copyFolder]\(sourceFolder, destinationFolder)
Copies the sourcefolder to the destination folder, recursively.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#createFile]\(targetFile)
Creates a JSFile instance.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#createFolder]\(targetFolder)
Creates a folder on disk.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#createTempFile]\(filePrefix, fileSuffix)
Creates a temporary file on disk.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#deleteFile]\(targetFile)
Removes a file from disk.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#deleteFolder]\(targetFolder, showWarning)
Deletes a folder from disk recursively.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#getDesktopFolder]\()
Returns a JSFile instance that corresponds to the Desktop folder of the currently logged in user.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]\[]{td}{td}[#getDiskList]\()
Returns an Array of JSFile instances correponding to the file system root folders.{td}{tr}{tbody}{tbody}{tr}{td}[Number]{td}{td}[#getFileSize]\(targetFile)
Returns the size of the specified file.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]\[]{td}{td}[#getFolderContents]\(targetFolder, fileFilter, fileOption(1=files,2=dirs), visibleOption(1=visible,2=nonvisible), lockedOption(1=locked,2=nonlocked))
Returns an array of JSFile instances corresponding to content of the specified folder.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#getHomeDirectory]\()
Returns a JSFile instance corresponding to the home folder of the logged in used.{td}{tr}{tbody}{tbody}{tr}{td}[Date]{td}{td}[#getModificationDate]\(targetFile)
Returns the modification date of a file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#moveFile]\(sourceFile, destinationFile)
Moves the file from the source to the destination place.{td}{tr}{tbody}{tbody}{tr}{td}byte[]{td}{td}[#readFile]\(file, size)
Reads all or part of the content from a binary file.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#readTXTFile]\(file, charsetname)
Read all content from a text file.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#showDirectorySelectDialog]\(directory suggestion)
Shows a directory selector dialog.{td}{tr}{tbody}{tbody}{tr}{td}Object{td}{td}[#showFileOpenDialog]\(selectionMode(0=both,1=Files,2=Dirs), startDirectory(null=default/previous), multiselect(true/false), filterarray)
Shows a file open dialog.{td}{tr}{tbody}{tbody}{tr}{td}[JSFile]{td}{td}[#showFileSaveDialog]\(fileName/dir suggestion)
Shows a file save dialog.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#writeFile]\(file, binary_data)
Writes data into a binary file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#writeTXTFile]\(file, text_data, charsetname)
Writes data into a text file.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#writeXMLFile]\(file, xml_data)
Writes data into an XML file.{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=1CDDE85882FA2338-B720A68F-4EFD4F93-93B7B00C-BE14A5BB51DE1C5886196577}{tr:id=name}{td}h6.convertToJSFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}convertToJSFile{span}{span:id=iets|style=float: left;}\(file){span}{td}{tr}{tr:id=des}{td}{sub-section:1CDDE85882FA2338-B720A68F-4EFD4F93-93B7B00C-BE14A5BB51DE1C5886196577_des|text=|trigger=button}{sub-section}{sub-section:1CDDE85882FA2338-B720A68F-4EFD4F93-93B7B00C-BE14A5BB51DE1C5886196577_des|trigger=none|class=sIndent}Returns a JSFile instance corresponding to an alternative representation of a file (for example a string).{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:1CDDE85882FA2338-B720A68F-4EFD4F93-93B7B00C-BE14A5BB51DE1C5886196577_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:1CDDE85882FA2338-B720A68F-4EFD4F93-93B7B00C-BE14A5BB51DE1C5886196577_prs|trigger=none}file
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:1CDDE85882FA2338-B720A68F-4EFD4F93-93B7B00C-BE14A5BB51DE1C5886196577_ret|text=|trigger=button}{sub-section}{sub-section:1CDDE85882FA2338-B720A68F-4EFD4F93-93B7B00C-BE14A5BB51DE1C5886196577_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:1CDDE85882FA2338-B720A68F-4EFD4F93-93B7B00C-BE14A5BB51DE1C5886196577_see|text=|trigger=button}{sub-section}{sub-section:1CDDE85882FA2338-B720A68F-4EFD4F93-93B7B00C-BE14A5BB51DE1C5886196577_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:1CDDE85882FA2338-B720A68F-4EFD4F93-93B7B00C-BE14A5BB51DE1C5886196577_see|text=|trigger=button}{sub-section}{sub-section:1CDDE85882FA2338-B720A68F-4EFD4F93-93B7B00C-BE14A5BB51DE1C5886196577_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:1CDDE85882FA2338-B720A68F-4EFD4F93-93B7B00C-BE14A5BB51DE1C5886196577_sam|text=|trigger=button}{sub-section}{sub-section:1CDDE85882FA2338-B720A68F-4EFD4F93-93B7B00C-BE14A5BB51DE1C5886196577_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile("story.txt");
if (f.canRead())
	application.output("File can be read.");
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=61FBA5E355C6D44A-BA69E6D9-47064D84-9BE499A6-917CF20DE8A2E107FD219889}{tr:id=name}{td}h6.copyFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}copyFile{span}{span:id=iets|style=float: left;}\(sourceFile, destinationFile){span}{td}{tr}{tr:id=des}{td}{sub-section:61FBA5E355C6D44A-BA69E6D9-47064D84-9BE499A6-917CF20DE8A2E107FD219889_des|text=|trigger=button}{sub-section}{sub-section:61FBA5E355C6D44A-BA69E6D9-47064D84-9BE499A6-917CF20DE8A2E107FD219889_des|trigger=none|class=sIndent}Copies the sourcefile to the destination file. Returns true if the copy succeeds, false if any error occurs.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:61FBA5E355C6D44A-BA69E6D9-47064D84-9BE499A6-917CF20DE8A2E107FD219889_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:61FBA5E355C6D44A-BA69E6D9-47064D84-9BE499A6-917CF20DE8A2E107FD219889_prs|trigger=none}sourceFile
destinationFile
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:61FBA5E355C6D44A-BA69E6D9-47064D84-9BE499A6-917CF20DE8A2E107FD219889_ret|text=|trigger=button}{sub-section}{sub-section:61FBA5E355C6D44A-BA69E6D9-47064D84-9BE499A6-917CF20DE8A2E107FD219889_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:61FBA5E355C6D44A-BA69E6D9-47064D84-9BE499A6-917CF20DE8A2E107FD219889_see|text=|trigger=button}{sub-section}{sub-section:61FBA5E355C6D44A-BA69E6D9-47064D84-9BE499A6-917CF20DE8A2E107FD219889_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:61FBA5E355C6D44A-BA69E6D9-47064D84-9BE499A6-917CF20DE8A2E107FD219889_see|text=|trigger=button}{sub-section}{sub-section:61FBA5E355C6D44A-BA69E6D9-47064D84-9BE499A6-917CF20DE8A2E107FD219889_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:61FBA5E355C6D44A-BA69E6D9-47064D84-9BE499A6-917CF20DE8A2E107FD219889_sam|text=|trigger=button}{sub-section}{sub-section:61FBA5E355C6D44A-BA69E6D9-47064D84-9BE499A6-917CF20DE8A2E107FD219889_sam|class=sIndent|trigger=none}{code:language=javascript}
// Copy based on file names.
if (!plugins.file.copyFile("story.txt", "story.txt.copy"))
	application.output("Copy failed.");
// Copy based on JSFile instances.
var f = plugins.file.createFile("story.txt");
var fcopy = plugins.file.createFile("story.txt.copy2");
if (!plugins.file.copyFile(f, fcopy))
	application.output("Copy failed.");
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0C3A071792D8EA84-98D0B9BB-4A6D4825-BEFCA4B3-0F3C58D0A6E96F1DABB05F67}{tr:id=name}{td}h6.copyFolder{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}copyFolder{span}{span:id=iets|style=float: left;}\(sourceFolder, destinationFolder){span}{td}{tr}{tr:id=des}{td}{sub-section:0C3A071792D8EA84-98D0B9BB-4A6D4825-BEFCA4B3-0F3C58D0A6E96F1DABB05F67_des|text=|trigger=button}{sub-section}{sub-section:0C3A071792D8EA84-98D0B9BB-4A6D4825-BEFCA4B3-0F3C58D0A6E96F1DABB05F67_des|trigger=none|class=sIndent}Copies the sourcefolder to the destination folder, recursively. Returns true if the copy succeeds, false if any error occurs.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:0C3A071792D8EA84-98D0B9BB-4A6D4825-BEFCA4B3-0F3C58D0A6E96F1DABB05F67_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0C3A071792D8EA84-98D0B9BB-4A6D4825-BEFCA4B3-0F3C58D0A6E96F1DABB05F67_prs|trigger=none}sourceFolder
destinationFolder
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:0C3A071792D8EA84-98D0B9BB-4A6D4825-BEFCA4B3-0F3C58D0A6E96F1DABB05F67_ret|text=|trigger=button}{sub-section}{sub-section:0C3A071792D8EA84-98D0B9BB-4A6D4825-BEFCA4B3-0F3C58D0A6E96F1DABB05F67_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0C3A071792D8EA84-98D0B9BB-4A6D4825-BEFCA4B3-0F3C58D0A6E96F1DABB05F67_see|text=|trigger=button}{sub-section}{sub-section:0C3A071792D8EA84-98D0B9BB-4A6D4825-BEFCA4B3-0F3C58D0A6E96F1DABB05F67_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0C3A071792D8EA84-98D0B9BB-4A6D4825-BEFCA4B3-0F3C58D0A6E96F1DABB05F67_see|text=|trigger=button}{sub-section}{sub-section:0C3A071792D8EA84-98D0B9BB-4A6D4825-BEFCA4B3-0F3C58D0A6E96F1DABB05F67_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:0C3A071792D8EA84-98D0B9BB-4A6D4825-BEFCA4B3-0F3C58D0A6E96F1DABB05F67_sam|text=|trigger=button}{sub-section}{sub-section:0C3A071792D8EA84-98D0B9BB-4A6D4825-BEFCA4B3-0F3C58D0A6E96F1DABB05F67_sam|class=sIndent|trigger=none}{code:language=javascript}
// Copy folder based on names.
if (!plugins.file.copyFolder("stories", "stories_copy"))
	application.output("Folder copy failed.");
// Copy folder based on JSFile instances.
var d = plugins.file.createFile("stories");
var dcopy = plugins.file.createFile("stories_copy_2");
if (!plugins.file.copyFolder(d, dcopy))
	application.output("Folder copy failed.");
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F5A5DDA8CAF1C3FD-3B831ACD-40DC4CF8-86ED9224-C4A86A37495E351B30368EDD}{tr:id=name}{td}h6.createFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}createFile{span}{span:id=iets|style=float: left;}\(targetFile){span}{td}{tr}{tr:id=des}{td}{sub-section:F5A5DDA8CAF1C3FD-3B831ACD-40DC4CF8-86ED9224-C4A86A37495E351B30368EDD_des|text=|trigger=button}{sub-section}{sub-section:F5A5DDA8CAF1C3FD-3B831ACD-40DC4CF8-86ED9224-C4A86A37495E351B30368EDD_des|trigger=none|class=sIndent}Creates a JSFile instance. Does not create the file on disk.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:F5A5DDA8CAF1C3FD-3B831ACD-40DC4CF8-86ED9224-C4A86A37495E351B30368EDD_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F5A5DDA8CAF1C3FD-3B831ACD-40DC4CF8-86ED9224-C4A86A37495E351B30368EDD_prs|trigger=none}targetFile
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:F5A5DDA8CAF1C3FD-3B831ACD-40DC4CF8-86ED9224-C4A86A37495E351B30368EDD_ret|text=|trigger=button}{sub-section}{sub-section:F5A5DDA8CAF1C3FD-3B831ACD-40DC4CF8-86ED9224-C4A86A37495E351B30368EDD_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F5A5DDA8CAF1C3FD-3B831ACD-40DC4CF8-86ED9224-C4A86A37495E351B30368EDD_see|text=|trigger=button}{sub-section}{sub-section:F5A5DDA8CAF1C3FD-3B831ACD-40DC4CF8-86ED9224-C4A86A37495E351B30368EDD_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F5A5DDA8CAF1C3FD-3B831ACD-40DC4CF8-86ED9224-C4A86A37495E351B30368EDD_see|text=|trigger=button}{sub-section}{sub-section:F5A5DDA8CAF1C3FD-3B831ACD-40DC4CF8-86ED9224-C4A86A37495E351B30368EDD_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F5A5DDA8CAF1C3FD-3B831ACD-40DC4CF8-86ED9224-C4A86A37495E351B30368EDD_sam|text=|trigger=button}{sub-section}{sub-section:F5A5DDA8CAF1C3FD-3B831ACD-40DC4CF8-86ED9224-C4A86A37495E351B30368EDD_sam|class=sIndent|trigger=none}{code:language=javascript}
// Create the JSFile instance based on the file name.
var f = plugins.file.createFile("newfile.txt");
// Create the file on disk.
if (!f.createNewFile())
	application.output("The file could not be created.");
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D58857F593761273-06287659-401C4077-8B08B7BF-61858F997B1CE7004C05BBE5}{tr:id=name}{td}h6.createFolder{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}createFolder{span}{span:id=iets|style=float: left;}\(targetFolder){span}{td}{tr}{tr:id=des}{td}{sub-section:D58857F593761273-06287659-401C4077-8B08B7BF-61858F997B1CE7004C05BBE5_des|text=|trigger=button}{sub-section}{sub-section:D58857F593761273-06287659-401C4077-8B08B7BF-61858F997B1CE7004C05BBE5_des|trigger=none|class=sIndent}Creates a folder on disk. Returns true if the folder is successfully created, false if any error occurs.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:D58857F593761273-06287659-401C4077-8B08B7BF-61858F997B1CE7004C05BBE5_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D58857F593761273-06287659-401C4077-8B08B7BF-61858F997B1CE7004C05BBE5_prs|trigger=none}targetFolder
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:D58857F593761273-06287659-401C4077-8B08B7BF-61858F997B1CE7004C05BBE5_ret|text=|trigger=button}{sub-section}{sub-section:D58857F593761273-06287659-401C4077-8B08B7BF-61858F997B1CE7004C05BBE5_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D58857F593761273-06287659-401C4077-8B08B7BF-61858F997B1CE7004C05BBE5_see|text=|trigger=button}{sub-section}{sub-section:D58857F593761273-06287659-401C4077-8B08B7BF-61858F997B1CE7004C05BBE5_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D58857F593761273-06287659-401C4077-8B08B7BF-61858F997B1CE7004C05BBE5_see|text=|trigger=button}{sub-section}{sub-section:D58857F593761273-06287659-401C4077-8B08B7BF-61858F997B1CE7004C05BBE5_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:D58857F593761273-06287659-401C4077-8B08B7BF-61858F997B1CE7004C05BBE5_sam|text=|trigger=button}{sub-section}{sub-section:D58857F593761273-06287659-401C4077-8B08B7BF-61858F997B1CE7004C05BBE5_sam|class=sIndent|trigger=none}{code:language=javascript}
var d = plugins.file.convertToJSFile("newfolder");
if (!plugins.file.createFolder(d))
	application.output("Folder could not be created.");
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=958D15564872CE02-930E6837-43614DF0-8CA4898E-63858263619B1BFD6C124CBC}{tr:id=name}{td}h6.createTempFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}createTempFile{span}{span:id=iets|style=float: left;}\(filePrefix, fileSuffix){span}{td}{tr}{tr:id=des}{td}{sub-section:958D15564872CE02-930E6837-43614DF0-8CA4898E-63858263619B1BFD6C124CBC_des|text=|trigger=button}{sub-section}{sub-section:958D15564872CE02-930E6837-43614DF0-8CA4898E-63858263619B1BFD6C124CBC_des|trigger=none|class=sIndent}Creates a temporary file on disk. A prefix and an extension are specified and they will be part of the file name.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:958D15564872CE02-930E6837-43614DF0-8CA4898E-63858263619B1BFD6C124CBC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:958D15564872CE02-930E6837-43614DF0-8CA4898E-63858263619B1BFD6C124CBC_prs|trigger=none}filePrefix
fileSuffix
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:958D15564872CE02-930E6837-43614DF0-8CA4898E-63858263619B1BFD6C124CBC_ret|text=|trigger=button}{sub-section}{sub-section:958D15564872CE02-930E6837-43614DF0-8CA4898E-63858263619B1BFD6C124CBC_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:958D15564872CE02-930E6837-43614DF0-8CA4898E-63858263619B1BFD6C124CBC_see|text=|trigger=button}{sub-section}{sub-section:958D15564872CE02-930E6837-43614DF0-8CA4898E-63858263619B1BFD6C124CBC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:958D15564872CE02-930E6837-43614DF0-8CA4898E-63858263619B1BFD6C124CBC_see|text=|trigger=button}{sub-section}{sub-section:958D15564872CE02-930E6837-43614DF0-8CA4898E-63858263619B1BFD6C124CBC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:958D15564872CE02-930E6837-43614DF0-8CA4898E-63858263619B1BFD6C124CBC_sam|text=|trigger=button}{sub-section}{sub-section:958D15564872CE02-930E6837-43614DF0-8CA4898E-63858263619B1BFD6C124CBC_sam|class=sIndent|trigger=none}{code:language=javascript}
var tempFile = plugins.file.createTempFile('myfile','.txt');
application.output('Temporary file created as: ' + tempFile.getAbsolutePath());
plugins.file.writeTXTFile(tempFile, 'abcdefg');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=91607541BDD588B4-EAAB7147-486C4287-B4339BFE-1C9A982A0313087D8A8F482A}{tr:id=name}{td}h6.deleteFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}deleteFile{span}{span:id=iets|style=float: left;}\(targetFile){span}{td}{tr}{tr:id=des}{td}{sub-section:91607541BDD588B4-EAAB7147-486C4287-B4339BFE-1C9A982A0313087D8A8F482A_des|text=|trigger=button}{sub-section}{sub-section:91607541BDD588B4-EAAB7147-486C4287-B4339BFE-1C9A982A0313087D8A8F482A_des|trigger=none|class=sIndent}Removes a file from disk. Returns true on success, false otherwise.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:91607541BDD588B4-EAAB7147-486C4287-B4339BFE-1C9A982A0313087D8A8F482A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:91607541BDD588B4-EAAB7147-486C4287-B4339BFE-1C9A982A0313087D8A8F482A_prs|trigger=none}targetFile
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:91607541BDD588B4-EAAB7147-486C4287-B4339BFE-1C9A982A0313087D8A8F482A_ret|text=|trigger=button}{sub-section}{sub-section:91607541BDD588B4-EAAB7147-486C4287-B4339BFE-1C9A982A0313087D8A8F482A_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:91607541BDD588B4-EAAB7147-486C4287-B4339BFE-1C9A982A0313087D8A8F482A_see|text=|trigger=button}{sub-section}{sub-section:91607541BDD588B4-EAAB7147-486C4287-B4339BFE-1C9A982A0313087D8A8F482A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:91607541BDD588B4-EAAB7147-486C4287-B4339BFE-1C9A982A0313087D8A8F482A_see|text=|trigger=button}{sub-section}{sub-section:91607541BDD588B4-EAAB7147-486C4287-B4339BFE-1C9A982A0313087D8A8F482A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:91607541BDD588B4-EAAB7147-486C4287-B4339BFE-1C9A982A0313087D8A8F482A_sam|text=|trigger=button}{sub-section}{sub-section:91607541BDD588B4-EAAB7147-486C4287-B4339BFE-1C9A982A0313087D8A8F482A_sam|class=sIndent|trigger=none}{code:language=javascript}
if (plugins.file.deleteFile('story.txt'))
	application.output('File deleted.');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=3F6015275984E003-F225892F-45794373-AF74A175-96C417061227BC4C3D8A429B}{tr:id=name}{td}h6.deleteFolder{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}deleteFolder{span}{span:id=iets|style=float: left;}\(targetFolder, showWarning){span}{td}{tr}{tr:id=des}{td}{sub-section:3F6015275984E003-F225892F-45794373-AF74A175-96C417061227BC4C3D8A429B_des|text=|trigger=button}{sub-section}{sub-section:3F6015275984E003-F225892F-45794373-AF74A175-96C417061227BC4C3D8A429B_des|trigger=none|class=sIndent}Deletes a folder from disk recursively. Returns true on success, false otherwise. If the second parameter is set to true, then a warning will be issued to the user before actually removing the folder.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:3F6015275984E003-F225892F-45794373-AF74A175-96C417061227BC4C3D8A429B_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:3F6015275984E003-F225892F-45794373-AF74A175-96C417061227BC4C3D8A429B_prs|trigger=none}targetFolder
showWarning
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:3F6015275984E003-F225892F-45794373-AF74A175-96C417061227BC4C3D8A429B_ret|text=|trigger=button}{sub-section}{sub-section:3F6015275984E003-F225892F-45794373-AF74A175-96C417061227BC4C3D8A429B_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:3F6015275984E003-F225892F-45794373-AF74A175-96C417061227BC4C3D8A429B_see|text=|trigger=button}{sub-section}{sub-section:3F6015275984E003-F225892F-45794373-AF74A175-96C417061227BC4C3D8A429B_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:3F6015275984E003-F225892F-45794373-AF74A175-96C417061227BC4C3D8A429B_see|text=|trigger=button}{sub-section}{sub-section:3F6015275984E003-F225892F-45794373-AF74A175-96C417061227BC4C3D8A429B_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:3F6015275984E003-F225892F-45794373-AF74A175-96C417061227BC4C3D8A429B_sam|text=|trigger=button}{sub-section}{sub-section:3F6015275984E003-F225892F-45794373-AF74A175-96C417061227BC4C3D8A429B_sam|class=sIndent|trigger=none}{code:language=javascript}
if (plugins.file.deleteFolder('stories', true))
	application.output('Folder deleted.');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=FC8B562805C60E9B-48345FF4-4A0C464B-B28A98AC-886A9FB60650F38008D3675A}{tr:id=name}{td}h6.getDesktopFolder{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}getDesktopFolder{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:FC8B562805C60E9B-48345FF4-4A0C464B-B28A98AC-886A9FB60650F38008D3675A_des|text=|trigger=button}{sub-section}{sub-section:FC8B562805C60E9B-48345FF4-4A0C464B-B28A98AC-886A9FB60650F38008D3675A_des|trigger=none|class=sIndent}Returns a JSFile instance that corresponds to the Desktop folder of the currently logged in user.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:FC8B562805C60E9B-48345FF4-4A0C464B-B28A98AC-886A9FB60650F38008D3675A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:FC8B562805C60E9B-48345FF4-4A0C464B-B28A98AC-886A9FB60650F38008D3675A_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:FC8B562805C60E9B-48345FF4-4A0C464B-B28A98AC-886A9FB60650F38008D3675A_ret|text=|trigger=button}{sub-section}{sub-section:FC8B562805C60E9B-48345FF4-4A0C464B-B28A98AC-886A9FB60650F38008D3675A_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:FC8B562805C60E9B-48345FF4-4A0C464B-B28A98AC-886A9FB60650F38008D3675A_see|text=|trigger=button}{sub-section}{sub-section:FC8B562805C60E9B-48345FF4-4A0C464B-B28A98AC-886A9FB60650F38008D3675A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:FC8B562805C60E9B-48345FF4-4A0C464B-B28A98AC-886A9FB60650F38008D3675A_see|text=|trigger=button}{sub-section}{sub-section:FC8B562805C60E9B-48345FF4-4A0C464B-B28A98AC-886A9FB60650F38008D3675A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:FC8B562805C60E9B-48345FF4-4A0C464B-B28A98AC-886A9FB60650F38008D3675A_sam|text=|trigger=button}{sub-section}{sub-section:FC8B562805C60E9B-48345FF4-4A0C464B-B28A98AC-886A9FB60650F38008D3675A_sam|class=sIndent|trigger=none}{code:language=javascript}
var d = plugins.file.getDesktopFolder();
application.output('desktop folder is: ' + d.getAbsolutePath());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=E1010C0EDAB03EBA-5483AD15-4AEC4413-950E853E-EC5E07E3DCC86F0C34A8A50D}{tr:id=name}{td}h6.getDiskList{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getDiskList{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:E1010C0EDAB03EBA-5483AD15-4AEC4413-950E853E-EC5E07E3DCC86F0C34A8A50D_des|text=|trigger=button}{sub-section}{sub-section:E1010C0EDAB03EBA-5483AD15-4AEC4413-950E853E-EC5E07E3DCC86F0C34A8A50D_des|trigger=none|class=sIndent}Returns an Array of JSFile instances correponding to the file system root folders.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:E1010C0EDAB03EBA-5483AD15-4AEC4413-950E853E-EC5E07E3DCC86F0C34A8A50D_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E1010C0EDAB03EBA-5483AD15-4AEC4413-950E853E-EC5E07E3DCC86F0C34A8A50D_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:E1010C0EDAB03EBA-5483AD15-4AEC4413-950E853E-EC5E07E3DCC86F0C34A8A50D_ret|text=|trigger=button}{sub-section}{sub-section:E1010C0EDAB03EBA-5483AD15-4AEC4413-950E853E-EC5E07E3DCC86F0C34A8A50D_ret|trigger=none|class=sIndent}[JSFile]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E1010C0EDAB03EBA-5483AD15-4AEC4413-950E853E-EC5E07E3DCC86F0C34A8A50D_see|text=|trigger=button}{sub-section}{sub-section:E1010C0EDAB03EBA-5483AD15-4AEC4413-950E853E-EC5E07E3DCC86F0C34A8A50D_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E1010C0EDAB03EBA-5483AD15-4AEC4413-950E853E-EC5E07E3DCC86F0C34A8A50D_see|text=|trigger=button}{sub-section}{sub-section:E1010C0EDAB03EBA-5483AD15-4AEC4413-950E853E-EC5E07E3DCC86F0C34A8A50D_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E1010C0EDAB03EBA-5483AD15-4AEC4413-950E853E-EC5E07E3DCC86F0C34A8A50D_sam|text=|trigger=button}{sub-section}{sub-section:E1010C0EDAB03EBA-5483AD15-4AEC4413-950E853E-EC5E07E3DCC86F0C34A8A50D_sam|class=sIndent|trigger=none}{code:language=javascript}
var roots = plugins.file.getDiskList();
for (var i = 0; i < roots.length; i++)
	application.output(roots[i].getAbsolutePath());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=84D5DB6501BCC6A2-FFF75C33-4DFC4ADE-BCC6BB3D-6F9B08A09840D9441E379147}{tr:id=name}{td}h6.getFileSize{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Number]{span}{span:id=iets|style=float: left; font-weight: bold;}getFileSize{span}{span:id=iets|style=float: left;}\(targetFile){span}{td}{tr}{tr:id=des}{td}{sub-section:84D5DB6501BCC6A2-FFF75C33-4DFC4ADE-BCC6BB3D-6F9B08A09840D9441E379147_des|text=|trigger=button}{sub-section}{sub-section:84D5DB6501BCC6A2-FFF75C33-4DFC4ADE-BCC6BB3D-6F9B08A09840D9441E379147_des|trigger=none|class=sIndent}Returns the size of the specified file.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:84D5DB6501BCC6A2-FFF75C33-4DFC4ADE-BCC6BB3D-6F9B08A09840D9441E379147_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:84D5DB6501BCC6A2-FFF75C33-4DFC4ADE-BCC6BB3D-6F9B08A09840D9441E379147_prs|trigger=none}targetFile
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:84D5DB6501BCC6A2-FFF75C33-4DFC4ADE-BCC6BB3D-6F9B08A09840D9441E379147_ret|text=|trigger=button}{sub-section}{sub-section:84D5DB6501BCC6A2-FFF75C33-4DFC4ADE-BCC6BB3D-6F9B08A09840D9441E379147_ret|trigger=none|class=sIndent}[Number]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:84D5DB6501BCC6A2-FFF75C33-4DFC4ADE-BCC6BB3D-6F9B08A09840D9441E379147_see|text=|trigger=button}{sub-section}{sub-section:84D5DB6501BCC6A2-FFF75C33-4DFC4ADE-BCC6BB3D-6F9B08A09840D9441E379147_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:84D5DB6501BCC6A2-FFF75C33-4DFC4ADE-BCC6BB3D-6F9B08A09840D9441E379147_see|text=|trigger=button}{sub-section}{sub-section:84D5DB6501BCC6A2-FFF75C33-4DFC4ADE-BCC6BB3D-6F9B08A09840D9441E379147_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:84D5DB6501BCC6A2-FFF75C33-4DFC4ADE-BCC6BB3D-6F9B08A09840D9441E379147_sam|text=|trigger=button}{sub-section}{sub-section:84D5DB6501BCC6A2-FFF75C33-4DFC4ADE-BCC6BB3D-6F9B08A09840D9441E379147_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('story.txt');
application.output('file size: ' + plugins.file.getFileSize(f));
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=DF9506D4F4978514-AB218C59-49A44C4F-BD208D06-021C305DD80D323616D2A4C3}{tr:id=name}{td}h6.getFolderContents{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getFolderContents{span}{span:id=iets|style=float: left;}\(targetFolder, fileFilter, fileOption(1=files,2=dirs), visibleOption(1=visible,2=nonvisible), lockedOption(1=locked,2=nonlocked)){span}{td}{tr}{tr:id=des}{td}{sub-section:DF9506D4F4978514-AB218C59-49A44C4F-BD208D06-021C305DD80D323616D2A4C3_des|text=|trigger=button}{sub-section}{sub-section:DF9506D4F4978514-AB218C59-49A44C4F-BD208D06-021C305DD80D323616D2A4C3_des|trigger=none|class=sIndent}Returns an array of JSFile instances corresponding to content of the specified folder. The content can be filtered by optional name filter(s), by type, by visibility and by lock status.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:DF9506D4F4978514-AB218C59-49A44C4F-BD208D06-021C305DD80D323616D2A4C3_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DF9506D4F4978514-AB218C59-49A44C4F-BD208D06-021C305DD80D323616D2A4C3_prs|trigger=none}targetFolder
\[fileFilter\]
\[fileOption(1=files,2=dirs)\]
\[visibleOption(1=visible,2=nonvisible)\]
\[lockedOption(1=locked,2=nonlocked)\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:DF9506D4F4978514-AB218C59-49A44C4F-BD208D06-021C305DD80D323616D2A4C3_ret|text=|trigger=button}{sub-section}{sub-section:DF9506D4F4978514-AB218C59-49A44C4F-BD208D06-021C305DD80D323616D2A4C3_ret|trigger=none|class=sIndent}[JSFile]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:DF9506D4F4978514-AB218C59-49A44C4F-BD208D06-021C305DD80D323616D2A4C3_see|text=|trigger=button}{sub-section}{sub-section:DF9506D4F4978514-AB218C59-49A44C4F-BD208D06-021C305DD80D323616D2A4C3_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:DF9506D4F4978514-AB218C59-49A44C4F-BD208D06-021C305DD80D323616D2A4C3_see|text=|trigger=button}{sub-section}{sub-section:DF9506D4F4978514-AB218C59-49A44C4F-BD208D06-021C305DD80D323616D2A4C3_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:DF9506D4F4978514-AB218C59-49A44C4F-BD208D06-021C305DD80D323616D2A4C3_sam|text=|trigger=button}{sub-section}{sub-section:DF9506D4F4978514-AB218C59-49A44C4F-BD208D06-021C305DD80D323616D2A4C3_sam|class=sIndent|trigger=none}{code:language=javascript}
var files = plugins.file.getFolderContents('stories', '.txt');
for (var i=0; i<files.length; i++)
	application.output(files[i].getAbsolutePath());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=AA7D3D58BE6EA331-51EB9EB1-45FD454A-A2E3B088-95066CAD48E5A23E9D653708}{tr:id=name}{td}h6.getHomeDirectory{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}getHomeDirectory{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:AA7D3D58BE6EA331-51EB9EB1-45FD454A-A2E3B088-95066CAD48E5A23E9D653708_des|text=|trigger=button}{sub-section}{sub-section:AA7D3D58BE6EA331-51EB9EB1-45FD454A-A2E3B088-95066CAD48E5A23E9D653708_des|trigger=none|class=sIndent}Returns a JSFile instance corresponding to the home folder of the logged in used.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:AA7D3D58BE6EA331-51EB9EB1-45FD454A-A2E3B088-95066CAD48E5A23E9D653708_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:AA7D3D58BE6EA331-51EB9EB1-45FD454A-A2E3B088-95066CAD48E5A23E9D653708_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:AA7D3D58BE6EA331-51EB9EB1-45FD454A-A2E3B088-95066CAD48E5A23E9D653708_ret|text=|trigger=button}{sub-section}{sub-section:AA7D3D58BE6EA331-51EB9EB1-45FD454A-A2E3B088-95066CAD48E5A23E9D653708_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:AA7D3D58BE6EA331-51EB9EB1-45FD454A-A2E3B088-95066CAD48E5A23E9D653708_see|text=|trigger=button}{sub-section}{sub-section:AA7D3D58BE6EA331-51EB9EB1-45FD454A-A2E3B088-95066CAD48E5A23E9D653708_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:AA7D3D58BE6EA331-51EB9EB1-45FD454A-A2E3B088-95066CAD48E5A23E9D653708_see|text=|trigger=button}{sub-section}{sub-section:AA7D3D58BE6EA331-51EB9EB1-45FD454A-A2E3B088-95066CAD48E5A23E9D653708_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:AA7D3D58BE6EA331-51EB9EB1-45FD454A-A2E3B088-95066CAD48E5A23E9D653708_sam|text=|trigger=button}{sub-section}{sub-section:AA7D3D58BE6EA331-51EB9EB1-45FD454A-A2E3B088-95066CAD48E5A23E9D653708_sam|class=sIndent|trigger=none}{code:language=javascript}
var d = plugins.file.getHomeDirectory();
application.output('home folder: ' + d.getAbsolutePath());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=CDD5A428596BD4DD-71EED963-4D054AAB-95FAA684-84D7EBC08DC7A0C9268C7F5C}{tr:id=name}{td}h6.getModificationDate{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Date]{span}{span:id=iets|style=float: left; font-weight: bold;}getModificationDate{span}{span:id=iets|style=float: left;}\(targetFile){span}{td}{tr}{tr:id=des}{td}{sub-section:CDD5A428596BD4DD-71EED963-4D054AAB-95FAA684-84D7EBC08DC7A0C9268C7F5C_des|text=|trigger=button}{sub-section}{sub-section:CDD5A428596BD4DD-71EED963-4D054AAB-95FAA684-84D7EBC08DC7A0C9268C7F5C_des|trigger=none|class=sIndent}Returns the modification date of a file.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:CDD5A428596BD4DD-71EED963-4D054AAB-95FAA684-84D7EBC08DC7A0C9268C7F5C_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:CDD5A428596BD4DD-71EED963-4D054AAB-95FAA684-84D7EBC08DC7A0C9268C7F5C_prs|trigger=none}targetFile
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:CDD5A428596BD4DD-71EED963-4D054AAB-95FAA684-84D7EBC08DC7A0C9268C7F5C_ret|text=|trigger=button}{sub-section}{sub-section:CDD5A428596BD4DD-71EED963-4D054AAB-95FAA684-84D7EBC08DC7A0C9268C7F5C_ret|trigger=none|class=sIndent}[Date]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:CDD5A428596BD4DD-71EED963-4D054AAB-95FAA684-84D7EBC08DC7A0C9268C7F5C_see|text=|trigger=button}{sub-section}{sub-section:CDD5A428596BD4DD-71EED963-4D054AAB-95FAA684-84D7EBC08DC7A0C9268C7F5C_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:CDD5A428596BD4DD-71EED963-4D054AAB-95FAA684-84D7EBC08DC7A0C9268C7F5C_see|text=|trigger=button}{sub-section}{sub-section:CDD5A428596BD4DD-71EED963-4D054AAB-95FAA684-84D7EBC08DC7A0C9268C7F5C_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:CDD5A428596BD4DD-71EED963-4D054AAB-95FAA684-84D7EBC08DC7A0C9268C7F5C_sam|text=|trigger=button}{sub-section}{sub-section:CDD5A428596BD4DD-71EED963-4D054AAB-95FAA684-84D7EBC08DC7A0C9268C7F5C_sam|class=sIndent|trigger=none}{code:language=javascript}
var f = plugins.file.convertToJSFile('story.txt');
application.output('last changed: ' + plugins.file.getModificationDate(f));
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0BBD8F07E9BEA497-54DFC05E-4F994EC3-8993A4FC-789CBD6E40A87F6BCBCBD737}{tr:id=name}{td}h6.moveFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}moveFile{span}{span:id=iets|style=float: left;}\(sourceFile, destinationFile){span}{td}{tr}{tr:id=des}{td}{sub-section:0BBD8F07E9BEA497-54DFC05E-4F994EC3-8993A4FC-789CBD6E40A87F6BCBCBD737_des|text=|trigger=button}{sub-section}{sub-section:0BBD8F07E9BEA497-54DFC05E-4F994EC3-8993A4FC-789CBD6E40A87F6BCBCBD737_des|trigger=none|class=sIndent}Moves the file from the source to the destination place. Returns true on success, false otherwise.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:0BBD8F07E9BEA497-54DFC05E-4F994EC3-8993A4FC-789CBD6E40A87F6BCBCBD737_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0BBD8F07E9BEA497-54DFC05E-4F994EC3-8993A4FC-789CBD6E40A87F6BCBCBD737_prs|trigger=none}sourceFile
destinationFile
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:0BBD8F07E9BEA497-54DFC05E-4F994EC3-8993A4FC-789CBD6E40A87F6BCBCBD737_ret|text=|trigger=button}{sub-section}{sub-section:0BBD8F07E9BEA497-54DFC05E-4F994EC3-8993A4FC-789CBD6E40A87F6BCBCBD737_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0BBD8F07E9BEA497-54DFC05E-4F994EC3-8993A4FC-789CBD6E40A87F6BCBCBD737_see|text=|trigger=button}{sub-section}{sub-section:0BBD8F07E9BEA497-54DFC05E-4F994EC3-8993A4FC-789CBD6E40A87F6BCBCBD737_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0BBD8F07E9BEA497-54DFC05E-4F994EC3-8993A4FC-789CBD6E40A87F6BCBCBD737_see|text=|trigger=button}{sub-section}{sub-section:0BBD8F07E9BEA497-54DFC05E-4F994EC3-8993A4FC-789CBD6E40A87F6BCBCBD737_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:0BBD8F07E9BEA497-54DFC05E-4F994EC3-8993A4FC-789CBD6E40A87F6BCBCBD737_sam|text=|trigger=button}{sub-section}{sub-section:0BBD8F07E9BEA497-54DFC05E-4F994EC3-8993A4FC-789CBD6E40A87F6BCBCBD737_sam|class=sIndent|trigger=none}{code:language=javascript}
// Move file based on names.
if (!plugins.file.moveFile('story.txt','story.txt.new'))
	application.output('File move failed.');
// Move file based on JSFile instances.
var f = plugins.file.convertToJSFile('story.txt.new');
var fmoved = plugins.file.convertToJSFile('story.txt');
if (!plugins.file.moveFile(f, fmoved))
	application.output('File move back failed.');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=4DCD055D9DD7BF60-1A6CB998-48D14337-94E1AAD4-7021D7982BB1695EC06DFF5A}{tr:id=name}{td}h6.readFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}byte[]{span}{span:id=iets|style=float: left; font-weight: bold;}readFile{span}{span:id=iets|style=float: left;}\(file, size){span}{td}{tr}{tr:id=des}{td}{sub-section:4DCD055D9DD7BF60-1A6CB998-48D14337-94E1AAD4-7021D7982BB1695EC06DFF5A_des|text=|trigger=button}{sub-section}{sub-section:4DCD055D9DD7BF60-1A6CB998-48D14337-94E1AAD4-7021D7982BB1695EC06DFF5A_des|trigger=none|class=sIndent}Reads all or part of the content from a binary file. If a file name is not specified, then a file selection dialog pops up for selecting a file.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:4DCD055D9DD7BF60-1A6CB998-48D14337-94E1AAD4-7021D7982BB1695EC06DFF5A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:4DCD055D9DD7BF60-1A6CB998-48D14337-94E1AAD4-7021D7982BB1695EC06DFF5A_prs|trigger=none}\[file\]
\[size\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:4DCD055D9DD7BF60-1A6CB998-48D14337-94E1AAD4-7021D7982BB1695EC06DFF5A_ret|text=|trigger=button}{sub-section}{sub-section:4DCD055D9DD7BF60-1A6CB998-48D14337-94E1AAD4-7021D7982BB1695EC06DFF5A_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:4DCD055D9DD7BF60-1A6CB998-48D14337-94E1AAD4-7021D7982BB1695EC06DFF5A_see|text=|trigger=button}{sub-section}{sub-section:4DCD055D9DD7BF60-1A6CB998-48D14337-94E1AAD4-7021D7982BB1695EC06DFF5A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:4DCD055D9DD7BF60-1A6CB998-48D14337-94E1AAD4-7021D7982BB1695EC06DFF5A_see|text=|trigger=button}{sub-section}{sub-section:4DCD055D9DD7BF60-1A6CB998-48D14337-94E1AAD4-7021D7982BB1695EC06DFF5A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:4DCD055D9DD7BF60-1A6CB998-48D14337-94E1AAD4-7021D7982BB1695EC06DFF5A_sam|text=|trigger=button}{sub-section}{sub-section:4DCD055D9DD7BF60-1A6CB998-48D14337-94E1AAD4-7021D7982BB1695EC06DFF5A_sam|class=sIndent|trigger=none}{code:language=javascript}
// Read all content from the file.
var bytes = plugins.file.readFile('big.jpg');
application.output('file size: ' + bytes.length);
// Read only the first 1KB from the file.
var bytesPartial = plugins.file.readFile('big.jpg', 1024);
application.output('partial file size: ' + bytesPartial.length);
// Read all content from a file selected from the file open dialog.
var bytesUnknownFile = plugins.file.readFile();
application.output('unknown file size: ' + bytesUnknownFile.length);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=9162BE88EA6F7575-69AFCE28-47C24C40-B0C68F01-1A048F672026EFA34B0F7CB1}{tr:id=name}{td}h6.readTXTFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}readTXTFile{span}{span:id=iets|style=float: left;}\(file, charsetname){span}{td}{tr}{tr:id=des}{td}{sub-section:9162BE88EA6F7575-69AFCE28-47C24C40-B0C68F01-1A048F672026EFA34B0F7CB1_des|text=|trigger=button}{sub-section}{sub-section:9162BE88EA6F7575-69AFCE28-47C24C40-B0C68F01-1A048F672026EFA34B0F7CB1_des|trigger=none|class=sIndent}Read all content from a text file. If a file name is not specified, then a file selection dialog pops up for selecting a file. The encoding can be also specified.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:9162BE88EA6F7575-69AFCE28-47C24C40-B0C68F01-1A048F672026EFA34B0F7CB1_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:9162BE88EA6F7575-69AFCE28-47C24C40-B0C68F01-1A048F672026EFA34B0F7CB1_prs|trigger=none}\[file\]
\[charsetname\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:9162BE88EA6F7575-69AFCE28-47C24C40-B0C68F01-1A048F672026EFA34B0F7CB1_ret|text=|trigger=button}{sub-section}{sub-section:9162BE88EA6F7575-69AFCE28-47C24C40-B0C68F01-1A048F672026EFA34B0F7CB1_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:9162BE88EA6F7575-69AFCE28-47C24C40-B0C68F01-1A048F672026EFA34B0F7CB1_see|text=|trigger=button}{sub-section}{sub-section:9162BE88EA6F7575-69AFCE28-47C24C40-B0C68F01-1A048F672026EFA34B0F7CB1_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:9162BE88EA6F7575-69AFCE28-47C24C40-B0C68F01-1A048F672026EFA34B0F7CB1_see|text=|trigger=button}{sub-section}{sub-section:9162BE88EA6F7575-69AFCE28-47C24C40-B0C68F01-1A048F672026EFA34B0F7CB1_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:9162BE88EA6F7575-69AFCE28-47C24C40-B0C68F01-1A048F672026EFA34B0F7CB1_sam|text=|trigger=button}{sub-section}{sub-section:9162BE88EA6F7575-69AFCE28-47C24C40-B0C68F01-1A048F672026EFA34B0F7CB1_sam|class=sIndent|trigger=none}{code:language=javascript}
// Read content from a known text file.
var txt = plugins.file.readTXTFile('story.txt');
application.output(txt);
// Read content from a text file selected from the file open dialog.
var txtUnknown = plugins.file.readTXTFile();
application.output(txtUnknown);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=BB92562B2893738E-B921E1F3-42084FAD-9FABB78C-32D4BED63FC53A66E18CDC8F}{tr:id=name}{td}h6.showDirectorySelectDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}showDirectorySelectDialog{span}{span:id=iets|style=float: left;}\(directory suggestion){span}{td}{tr}{tr:id=des}{td}{sub-section:BB92562B2893738E-B921E1F3-42084FAD-9FABB78C-32D4BED63FC53A66E18CDC8F_des|text=|trigger=button}{sub-section}{sub-section:BB92562B2893738E-B921E1F3-42084FAD-9FABB78C-32D4BED63FC53A66E18CDC8F_des|trigger=none|class=sIndent}Shows a directory selector dialog.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:BB92562B2893738E-B921E1F3-42084FAD-9FABB78C-32D4BED63FC53A66E18CDC8F_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:BB92562B2893738E-B921E1F3-42084FAD-9FABB78C-32D4BED63FC53A66E18CDC8F_prs|trigger=none}\[directory suggestion\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:BB92562B2893738E-B921E1F3-42084FAD-9FABB78C-32D4BED63FC53A66E18CDC8F_ret|text=|trigger=button}{sub-section}{sub-section:BB92562B2893738E-B921E1F3-42084FAD-9FABB78C-32D4BED63FC53A66E18CDC8F_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:BB92562B2893738E-B921E1F3-42084FAD-9FABB78C-32D4BED63FC53A66E18CDC8F_see|text=|trigger=button}{sub-section}{sub-section:BB92562B2893738E-B921E1F3-42084FAD-9FABB78C-32D4BED63FC53A66E18CDC8F_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:BB92562B2893738E-B921E1F3-42084FAD-9FABB78C-32D4BED63FC53A66E18CDC8F_see|text=|trigger=button}{sub-section}{sub-section:BB92562B2893738E-B921E1F3-42084FAD-9FABB78C-32D4BED63FC53A66E18CDC8F_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:BB92562B2893738E-B921E1F3-42084FAD-9FABB78C-32D4BED63FC53A66E18CDC8F_sam|text=|trigger=button}{sub-section}{sub-section:BB92562B2893738E-B921E1F3-42084FAD-9FABB78C-32D4BED63FC53A66E18CDC8F_sam|class=sIndent|trigger=none}{code:language=javascript}
var dir = plugins.file.showDirectorySelectDialog();
application.output("you've selected folder: " + dir.getAbsolutePath());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0F24E478BDF01546-7C3E97DF-45E343AC-A01084A0-D13D7F20BE8AECD41A83F99B}{tr:id=name}{td}h6.showFileOpenDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}Object{span}{span:id=iets|style=float: left; font-weight: bold;}showFileOpenDialog{span}{span:id=iets|style=float: left;}\(selectionMode(0=both,1=Files,2=Dirs), startDirectory(null=default/previous), multiselect(true/false), filterarray){span}{td}{tr}{tr:id=des}{td}{sub-section:0F24E478BDF01546-7C3E97DF-45E343AC-A01084A0-D13D7F20BE8AECD41A83F99B_des|text=|trigger=button}{sub-section}{sub-section:0F24E478BDF01546-7C3E97DF-45E343AC-A01084A0-D13D7F20BE8AECD41A83F99B_des|trigger=none|class=sIndent}Shows a file open dialog. Filters can be applied on what type of files can be selected.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:0F24E478BDF01546-7C3E97DF-45E343AC-A01084A0-D13D7F20BE8AECD41A83F99B_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0F24E478BDF01546-7C3E97DF-45E343AC-A01084A0-D13D7F20BE8AECD41A83F99B_prs|trigger=none}\[selectionMode(0=both,1=Files,2=Dirs)\]
\[startDirectory(null=default/previous)\]
\[multiselect(true/false)\]
\[filterarray\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:0F24E478BDF01546-7C3E97DF-45E343AC-A01084A0-D13D7F20BE8AECD41A83F99B_ret|text=|trigger=button}{sub-section}{sub-section:0F24E478BDF01546-7C3E97DF-45E343AC-A01084A0-D13D7F20BE8AECD41A83F99B_ret|trigger=none|class=sIndent}Object{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0F24E478BDF01546-7C3E97DF-45E343AC-A01084A0-D13D7F20BE8AECD41A83F99B_see|text=|trigger=button}{sub-section}{sub-section:0F24E478BDF01546-7C3E97DF-45E343AC-A01084A0-D13D7F20BE8AECD41A83F99B_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0F24E478BDF01546-7C3E97DF-45E343AC-A01084A0-D13D7F20BE8AECD41A83F99B_see|text=|trigger=button}{sub-section}{sub-section:0F24E478BDF01546-7C3E97DF-45E343AC-A01084A0-D13D7F20BE8AECD41A83F99B_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:0F24E478BDF01546-7C3E97DF-45E343AC-A01084A0-D13D7F20BE8AECD41A83F99B_sam|text=|trigger=button}{sub-section}{sub-section:0F24E478BDF01546-7C3E97DF-45E343AC-A01084A0-D13D7F20BE8AECD41A83F99B_sam|class=sIndent|trigger=none}{code:language=javascript}
// This selects only files ('1'), previous dir must be used ('null'), no multiselect ('false') and
// the filter "JPG and GIF" should be used: ('new Array("JPG and GIF","jpg","gif")').
var file = plugins.file.showFileOpenDialog(1, null, false, new Array("JPG and GIF","jpg","gif"));
application.output("you've selected file: " + file.getAbsolutePath());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B4BE098746ACFE54-7D9D1D9A-4D224C3A-B25DB285-757F99E467B4515246E59A49}{tr:id=name}{td}h6.showFileSaveDialog{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[JSFile]{span}{span:id=iets|style=float: left; font-weight: bold;}showFileSaveDialog{span}{span:id=iets|style=float: left;}\(fileName/dir suggestion){span}{td}{tr}{tr:id=des}{td}{sub-section:B4BE098746ACFE54-7D9D1D9A-4D224C3A-B25DB285-757F99E467B4515246E59A49_des|text=|trigger=button}{sub-section}{sub-section:B4BE098746ACFE54-7D9D1D9A-4D224C3A-B25DB285-757F99E467B4515246E59A49_des|trigger=none|class=sIndent}Shows a file save dialog.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:B4BE098746ACFE54-7D9D1D9A-4D224C3A-B25DB285-757F99E467B4515246E59A49_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B4BE098746ACFE54-7D9D1D9A-4D224C3A-B25DB285-757F99E467B4515246E59A49_prs|trigger=none}\[fileName/dir suggestion\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:B4BE098746ACFE54-7D9D1D9A-4D224C3A-B25DB285-757F99E467B4515246E59A49_ret|text=|trigger=button}{sub-section}{sub-section:B4BE098746ACFE54-7D9D1D9A-4D224C3A-B25DB285-757F99E467B4515246E59A49_ret|trigger=none|class=sIndent}[JSFile]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B4BE098746ACFE54-7D9D1D9A-4D224C3A-B25DB285-757F99E467B4515246E59A49_see|text=|trigger=button}{sub-section}{sub-section:B4BE098746ACFE54-7D9D1D9A-4D224C3A-B25DB285-757F99E467B4515246E59A49_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B4BE098746ACFE54-7D9D1D9A-4D224C3A-B25DB285-757F99E467B4515246E59A49_see|text=|trigger=button}{sub-section}{sub-section:B4BE098746ACFE54-7D9D1D9A-4D224C3A-B25DB285-757F99E467B4515246E59A49_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:B4BE098746ACFE54-7D9D1D9A-4D224C3A-B25DB285-757F99E467B4515246E59A49_sam|text=|trigger=button}{sub-section}{sub-section:B4BE098746ACFE54-7D9D1D9A-4D224C3A-B25DB285-757F99E467B4515246E59A49_sam|class=sIndent|trigger=none}{code:language=javascript}
var file = plugins.file.showFileSaveDialog();
application.output("you've selected file: " + file.getAbsolutePath());
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F838C712E444CA4E-E73B36D5-4BD84FD7-8A94B831-815D5DEE101ED83359CBF556}{tr:id=name}{td}h6.writeFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}writeFile{span}{span:id=iets|style=float: left;}\(file, binary_data){span}{td}{tr}{tr:id=des}{td}{sub-section:F838C712E444CA4E-E73B36D5-4BD84FD7-8A94B831-815D5DEE101ED83359CBF556_des|text=|trigger=button}{sub-section}{sub-section:F838C712E444CA4E-E73B36D5-4BD84FD7-8A94B831-815D5DEE101ED83359CBF556_des|trigger=none|class=sIndent}Writes data into a binary file.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:F838C712E444CA4E-E73B36D5-4BD84FD7-8A94B831-815D5DEE101ED83359CBF556_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F838C712E444CA4E-E73B36D5-4BD84FD7-8A94B831-815D5DEE101ED83359CBF556_prs|trigger=none}file
binary_data
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:F838C712E444CA4E-E73B36D5-4BD84FD7-8A94B831-815D5DEE101ED83359CBF556_ret|text=|trigger=button}{sub-section}{sub-section:F838C712E444CA4E-E73B36D5-4BD84FD7-8A94B831-815D5DEE101ED83359CBF556_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F838C712E444CA4E-E73B36D5-4BD84FD7-8A94B831-815D5DEE101ED83359CBF556_see|text=|trigger=button}{sub-section}{sub-section:F838C712E444CA4E-E73B36D5-4BD84FD7-8A94B831-815D5DEE101ED83359CBF556_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F838C712E444CA4E-E73B36D5-4BD84FD7-8A94B831-815D5DEE101ED83359CBF556_see|text=|trigger=button}{sub-section}{sub-section:F838C712E444CA4E-E73B36D5-4BD84FD7-8A94B831-815D5DEE101ED83359CBF556_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:F838C712E444CA4E-E73B36D5-4BD84FD7-8A94B831-815D5DEE101ED83359CBF556_sam|text=|trigger=button}{sub-section}{sub-section:F838C712E444CA4E-E73B36D5-4BD84FD7-8A94B831-815D5DEE101ED83359CBF556_sam|class=sIndent|trigger=none}{code:language=javascript}
var bytes = new Array();
for (var i=0; i<1024; i++)
	bytes[i] = i % 100;
var f = plugins.file.convertToJSFile('bin.dat');
if (!plugins.file.writeFile(f, bytes))
	application.output('Failed to write the file.');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=920A9D7D29FEEDD4-18450982-4B574263-BAA8BE6B-1FABD341F5FFD2619D683569}{tr:id=name}{td}h6.writeTXTFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}writeTXTFile{span}{span:id=iets|style=float: left;}\(file, text_data, charsetname){span}{td}{tr}{tr:id=des}{td}{sub-section:920A9D7D29FEEDD4-18450982-4B574263-BAA8BE6B-1FABD341F5FFD2619D683569_des|text=|trigger=button}{sub-section}{sub-section:920A9D7D29FEEDD4-18450982-4B574263-BAA8BE6B-1FABD341F5FFD2619D683569_des|trigger=none|class=sIndent}Writes data into a text file.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:920A9D7D29FEEDD4-18450982-4B574263-BAA8BE6B-1FABD341F5FFD2619D683569_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:920A9D7D29FEEDD4-18450982-4B574263-BAA8BE6B-1FABD341F5FFD2619D683569_prs|trigger=none}file
text_data
\[charsetname\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:920A9D7D29FEEDD4-18450982-4B574263-BAA8BE6B-1FABD341F5FFD2619D683569_ret|text=|trigger=button}{sub-section}{sub-section:920A9D7D29FEEDD4-18450982-4B574263-BAA8BE6B-1FABD341F5FFD2619D683569_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:920A9D7D29FEEDD4-18450982-4B574263-BAA8BE6B-1FABD341F5FFD2619D683569_see|text=|trigger=button}{sub-section}{sub-section:920A9D7D29FEEDD4-18450982-4B574263-BAA8BE6B-1FABD341F5FFD2619D683569_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:920A9D7D29FEEDD4-18450982-4B574263-BAA8BE6B-1FABD341F5FFD2619D683569_see|text=|trigger=button}{sub-section}{sub-section:920A9D7D29FEEDD4-18450982-4B574263-BAA8BE6B-1FABD341F5FFD2619D683569_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:920A9D7D29FEEDD4-18450982-4B574263-BAA8BE6B-1FABD341F5FFD2619D683569_sam|text=|trigger=button}{sub-section}{sub-section:920A9D7D29FEEDD4-18450982-4B574263-BAA8BE6B-1FABD341F5FFD2619D683569_sam|class=sIndent|trigger=none}{code:language=javascript}
var fileNameSuggestion = 'myspecialexport.tab'
var textData = 'load of data...'
var success = plugins.file.writeTXTFile(fileNameSuggestion, textData);
if (!success) application.output('Could not write file.');
// For file-encoding parameter options (default OS encoding is used), http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=150C4E7A9A05528C-0BC19E95-4513411D-83B288F6-8470E558FDE2D95A7B3EAD33}{tr:id=name}{td}h6.writeXMLFile{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}writeXMLFile{span}{span:id=iets|style=float: left;}\(file, xml_data){span}{td}{tr}{tr:id=des}{td}{sub-section:150C4E7A9A05528C-0BC19E95-4513411D-83B288F6-8470E558FDE2D95A7B3EAD33_des|text=|trigger=button}{sub-section}{sub-section:150C4E7A9A05528C-0BC19E95-4513411D-83B288F6-8470E558FDE2D95A7B3EAD33_des|trigger=none|class=sIndent}Writes data into an XML file. The file is saved with the encoding specified by the XML itself.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:150C4E7A9A05528C-0BC19E95-4513411D-83B288F6-8470E558FDE2D95A7B3EAD33_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:150C4E7A9A05528C-0BC19E95-4513411D-83B288F6-8470E558FDE2D95A7B3EAD33_prs|trigger=none}file
xml_data
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:150C4E7A9A05528C-0BC19E95-4513411D-83B288F6-8470E558FDE2D95A7B3EAD33_ret|text=|trigger=button}{sub-section}{sub-section:150C4E7A9A05528C-0BC19E95-4513411D-83B288F6-8470E558FDE2D95A7B3EAD33_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:150C4E7A9A05528C-0BC19E95-4513411D-83B288F6-8470E558FDE2D95A7B3EAD33_see|text=|trigger=button}{sub-section}{sub-section:150C4E7A9A05528C-0BC19E95-4513411D-83B288F6-8470E558FDE2D95A7B3EAD33_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:150C4E7A9A05528C-0BC19E95-4513411D-83B288F6-8470E558FDE2D95A7B3EAD33_see|text=|trigger=button}{sub-section}{sub-section:150C4E7A9A05528C-0BC19E95-4513411D-83B288F6-8470E558FDE2D95A7B3EAD33_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:150C4E7A9A05528C-0BC19E95-4513411D-83B288F6-8470E558FDE2D95A7B3EAD33_sam|text=|trigger=button}{sub-section}{sub-section:150C4E7A9A05528C-0BC19E95-4513411D-83B288F6-8470E558FDE2D95A7B3EAD33_sam|class=sIndent|trigger=none}{code:language=javascript}
var fileName = 'form.xml'
var xml = controller.printXML()
var success = plugins.file.writeXMLFile(fileName, xml);
if (!success) application.output('Could not write file.');
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}