Skip to content

Latest commit

 

History

History
54 lines (29 loc) · 2.89 KB

en.md

File metadata and controls

54 lines (29 loc) · 2.89 KB

rename-files

Rename batch of files interactively using JXA 😁~

Inspired by dtinth's Batch File Rename.

What is JXA

It's OS X automation, using Javascript.

Requirements

For using JXA language, Mac OS X Yosemite is required.

Since OS X 10.10 (Yosemite), Javascript (called Javascript for Automation, or JXA) is also supported for app automation.

Installation

  1. git clone [email protected]:YYCoder/rename-files.git: clone this repository

  2. yarn build: bundle typescript files to JXA

    yarn build will generate a JXA script named index.scpt at your current working dictionary.

  3. add it to OS X Service or you can save it as an app, also just use osascript to run it

How to use it

  1. First step, select files:

  2. Next, there are two ways to rename files, as follows:

    1. you can simply write JavaScript code in the input, and this program will run it as a function, which return the new name. For example:

    2. you can click the Case button, then you will see this dialog:

  3. Then, you will see the diff dialog:

  4. Press the confirm button, that's it!

Development

  • yarn dev: bundle typescript files to develop, which will not write bundled file to disk

  • yarn build: bundle and compress typescript files, then write it to disk

Bundling depends on ts-jxa, which is a robust tool to help you develop JXA using typescript.

Other JXA resources