Restart frozen app on Windows OS

This script kills the selected app and then opens it again. Works only on Windows OS.

// Name: Frozen
// Description: Kill a process and open it again
// Author: Positron
import "@johnlindquist/kit"
let fkill = await npm('fkill')
let open = await npm ('open')
let pslist = await npm ('ps-list')
let processes = await pslist()
let procArray = []
for (let i of processes){
let appChoice = await arg("Choose a process", procArray)
console.log(`Closing ${appChoice}`)
// requires the `force` option to work. Also needs the .exe
fkill(appChoice, {
force: true
await wait(1000)
console.log(`Opening ${appChoice}`)
// Doesn't work with the .exe so need to remove it
open(appChoice.replace(".exe", ""))