I created a tool to help me rename files "from within DroidScript".
This is not perfect but it could help you to perform what you're looking for.
This is a work in progress and it could be greatly improved.
To use it simply install the SPK on your phone.
Then, in the project you're trying you rename your files, import the lib with the following code:
app.LoadScript( "../RenameSourceFile/RenameSourceFile.js" );
// You can execute the spk to copy this code in your clipboard automatically
Once it's loaded, you can use it like this:
RenameSourceFile();
// Prompt for source and destination file.
RenameSourceFile( "script.js" ); // Prompt for destination file only.
RenameSourceFile( null, "renamed.js" );
// Prompt for source file only.
RenameSourceFile( "script.js", "renamed.js" );
// Only prompt the confirmation dialog.
RenameSourceFile( "script.js", "renamed.js", true );
// Rename without any prompting.
Notes:
- can move files between folders if folders already exists.
- changes takes effect immediatly, but the IDE needs to be refreshed:
- Wifi IDE: actualise the page (F5).
- Mobile IDE: exit the current project then reopen it.
- Mobile IDE: Accessing the source file again before refreshing the IDE will create an empty file (DS behavior).
- Thus it is preverable to be on the main app file when before calling RenameSourceFile.