I can't figure out how executeAsModal is working (404 errors)

I am finally starting to convert my plugins to UXP. Since my old CEP stuff uses suspendHistory all the time, I would like to use API version 2. Unfortunately I cannot reach most of the documentation as I always get a 404 error.

So maybe someone could explain to me, how I can change this simple function so that is “executedAsModal” and works with API v2. Sorry for this very basic question, but as I said I have basically zero access to any documentation ;(

async function createColorLayer() {
	const app = require('photoshop').app;
	await app.activeDocument.createLayer({ name: "farbe", opacity: 100, mode: "color" });
}

Thanks!

Read through this post. I put a link to a sample API 2 plugin in the post. You will just need to rename the ccx as zip to view it. Later on in the post, I also replied with how to do the suspendHistory.

Thanks @ddbell. I will give it another try later :slight_smile: