Skip to content

tomaschyly/FileCtor

Repository files navigation

FileCtor

File inspector with interactive javascript console.

Notice: MacOS version is not compatible with Apple Silicon (ARM)

Javascript console

The idea is to have something similar to other file system managers, e.g. TotalCommander. But this app is intended for Developers as it allows to run various JS scripts against files and directories.

Files & directory view

There are multiple script Snippets installed with the app. They will give you some functionality right away, without having to write your own first. Then you can of course write and save your own.

Saved code snippets

Contents

  1. Installation
  2. Important Notes
  3. How to Use
  4. Included script Snippets
  5. Roadmap

Installation

Windows

  1. Download latest Win32 release from here.
  2. Unzip anywhere, then you can copy the folder wherever you want the app to be, there is no installation.
  3. Run the app, optionally create shortcut to use.

MacOS

  1. Download latest Darwin release from here.
  2. Unzip anywhere, then copy app to your Applications folder.
  3. Run the app, optionally create shortcut to use.

Ubuntu

  1. Download latest Deb release from here.
  2. Unzip anywhere, then install the package.
  3. Run the app, optionally create shortcut to use.

Important Notes

This app is intended to be cross-platform, currently developed and tested on Windows 10, MacOS and Ubuntu 18.04 LTS.

App is using Electron and React as it was originally meant for me to improve my skill with Electron and learn properly React.

How to Use

Execute script

  1. On the main Files view, click the code button. Either in the files row on the right or at the bottom near the current directory.
    1. Now you have console open for you with current directory preselected for use by script.
    2. If you used the button inside the files row, then you have also the file/s preselected, but this is not yet fully implemented.
  2. Inside the top box is Javascript editor, here you can write code that will be executed.
  3. If you hit the question mark button, you will see current API reference for global variables and functions.
  4. Execute the code by hitting execute button. WARNING: be sure that you are in the correct directory and have correct selected files before you execute the script. I will NOT be responsible for any damage that you cause to yor own PC.
  5. Inside the middle box you will see result and any console.log that you used with your script. Here you will also see error.

Save script

    1. When you have already open console with written script, click the save button.
    2. Go to the Snippets view and click new snippet button to open the console. Write your script and then save with the save button.

Script API reference

  1. Open the console using any of the previously mentioned ways.
  2. Click the question mark button.

Want more capabilities (variables/methods)

    1. Write your request in here.
    2. Or use the contact form inside the app's About view.

Included script Snippets

Simple Example

This is just a basic script example that does almost nothing, but demonstrate that execution works.

Rename Files

Rename files to a new name and append with number if there are more than one.

Rename Files (part of name)

Rename files to a new name by changing part of name with provided new part.

Rename Host Sql

Script for renaming host inside Sql query. E.g. rename host of WP website when migrating from Dev to Prod. Should work on large Sql files.

TinyPNG Compress/Resize/Crop Images

Two scripts for images (PNG & JPG), one can compress them, the other can resize or crop. Crop is intelligent in determining area of interest. You need TinyPNG API key for them to work.

Roadmap

  • Import/Export code

  • Localization - However I know only limited number of languages

  • More files explorer like actions - LOW PRIORITY

  • More script capabilities - an ongoing process/dependant on requests

  • Simple GUI for snippets - TBD