As a Roblox developer, it is currently impossible to export custom files from a plugin.
If Roblox is able to address this issue, it would improve my development experience because it would allow me to both import, and export data from a plugin.
This would allow for the use of plugins as full on file editors, would allow plugins to export presets and other information for users to share, and would allow for a ton of other super useful plugins to be created.
I propose a function to go alongside StudioService:PromptImportFile()
and StudioService:PromptImportFiles()
, e.g. StudioService:PromptExportFile(filetypes, fileContent)
, it could have identical behavior, except, rather than importing, it simply exports.
Old request
As a Roblox developer, it is currently not possible to prompt to export files from studio.
If Roblox is able to address this issue, it would improve my development experience because it would allow me to write plugins which can both produce and accept large data sets, create file formats for my plugins, and more.
Here is a basic example of where this would be useful. Say you want to both import and export a script using a plugin. You can use local scriptFile = StudioService:PromptImportFile({"lua"})
to import it fairly easily.
Well, what if you then want to allow the user to save that script? At the moment the only way to get large data out of studio is to print it large pieces at a time and have the user copy and paste which means little to no binary content can safely be used, and large files can take extremely long amounts of time. Having the ability to prompt the user to save the file to the same location they loaded it from (or another location) would completely solve this.
For example, scriptFile:PromptExport({"lua"}, contents)
could prompt the user to save the file at its original path, allowing the .lua
extension, and then automatically update the scriptFile
object. Additionally, maybe you might want to prompt the export of a random file you haven’t yet imported, so having something like someFile = StudioService:PromptExportFile({"lua"}, contents)
would be perfect.
I think that the use cases of exporting files are not as clear as importing may be, but I think that the ability to import and export files is necessary for one or the other to be useful to plugins. Here are a couple examples of where exporting could be used in plugins where importing would be nearly useless otherwise:
- Some sort of game patching plugin which could both
Export
patches andImport
them to apply them to a game. This could allow a developer to even create a modding or submissions system for their games and allow users to send them files which the developer can completely automatically add to their game. - The ability to create Settings Presets and easily import and export studio settings.
- The ability to create Script Editor Theme files that can be imported and exported much much easier. A plugin has done this before, but they did it by having the user copy and share long strings with each other, and the plugin which did this has since gone off sale.
- Really the ability to just import or export any kind of setting presets or large sets of data, such as settings for the plugin itself.