> ## Content Index
> Fetch the complete content index at: https://www.bramadams.dev/llms.txt
> Use this file to discover other available public pages before exploring further.

# March 28 2023
- URL: https://www.bramadams.dev/202303281158/
- Published: 2023-03-28T16:06:55.000Z
- Updated: 2023-03-29T04:29:41.000Z
- Description: What will happen on March 28, 2023?
- Author: Bram Adams
- Tags: instabram

mj v5 is **really** good. check out those shadows! check out the detail of the reliefs! (notice: my publishing process automatically compresses images for the web so this image is actually higher quality in its original form)

![https://bram-adams.ghost.io/content/images/2023/03/mj-v5-gothic-home.png](https://bram-adams.ghost.io/content/images/2023/03/mj-v5-gothic-home.png)

mj v5 gothic home.png

Gen-1 has me reminiscing of using Runway back in 2019 (*b4 generative art was cool!*)

![https://bram-adams.ghost.io/content/images/2023/03/runway-gen-1-release.png](https://bram-adams.ghost.io/content/images/2023/03/runway-gen-1-release.png)

runway gen 1 release.png

## Code

A quick improvement to the rename image code for the [Ghost Publish plugin](https://github.com/bramses/obsidian-ghost-publish?ref=bramadams.dev). Now has an optional modal for file renaming before it moves folders!

```ts
// modal
export const renameFileModal = async (
	app: App,
	vault: Vault,
	fileName: string,
) => {
	const folderCreationModal = new FileRenameModal(
		app,
		fileName
	);

	folderCreationModal.open();
	const result = await folderCreationModal.waitForModalValue();

    return result;
};

class FileRenameModal extends Modal {
	result: string;
	fileName: string;
	modalPromise: Promise<string>;
	resolveModalPromise: (value: string) => void;

	constructor(
		app: App,
		fileName: string
	) {
		super(app);

		this.result = fileName;
		this.modalPromise = new Promise((resolve) => {
			this.resolveModalPromise = resolve;
		});
	}

	onOpen() {
		const { contentEl } = this;

		contentEl.createEl("h2", {
			text: `Rename image`,
		});

        new Setting(contentEl).addText((text) =>
			text
				.setPlaceholder("File Name")
				.setValue(this.fileName)
				.onChange((value) => {
					this.fileName = value;
				})
		);

		new Setting(contentEl).addButton((btn) =>
			btn
				.setButtonText("Submit")
				.setTooltip("Rename File")
				.setCta()
				.onClick(() => {
					this.resolveModalPromise(this.fileName);
					this.close();
				})
		);

	}

	waitForModalValue() {
		return this.modalPromise;
	}

	onClose() {
		const { contentEl } = this;
		contentEl.empty();
	}
}

// in addCommand()...

let renamedFile = sourceFile.name;

const result = await renameFileModal(
	this.app,
	this.app.vault,
	sourceFile.name
);

if (result) {
	if (result !== sourceFile.name && result !== "") {
		renamedFile = result;
	}
} else {
	return;
}

this.app.fileManager.renameFile(
	sourceFile,
	`${newParentFolderName}/${renamedFile}.png`
);

console.log(
	`Successfully moved/renamed ${fileName} to ${newParentFolderName}/${renamedFile}.png`
);

```

**bramadams.dev is a reader-supported [published Zettelkasten](https://www.bramadams.dev/about/). [Both free and paid subscriptions are available](#/portal). If you want to support my work, the best way is by taking out a paid subscription.**

## Tweets

> [pic.twitter.com/H9UdRpZEAf](https://t.co/H9UdRpZEAf?ref=bramadams.dev)
> 
> — Videos That Precede Events (@PrecedeVideos) [May 1, 2022](https://twitter.com/PrecedeVideos/status/1520838152809857025?ref%5Fsrc=twsrc%5Etfw&ref=bramadams.dev)