Script Kit: Shortcut to Everything

86
Script Kit: Shortcut to Everything

let createChoices = async () => {

let apps = await fileSearch(“”, {

onlyin: “/”,

kind: “application”,

})

let prefs = await fileSearch(“”, {

onlyin: “/”,

kind: “preferences”,

})

let group = path => apps =>

apps

.filter(app => app.match(path))

.sort((a, b) => {

let aName = a.replace(/.*//, “”)

let bName = b.replace(/.*//, “”)

return aName > bName ? 1 : aName < bName ? 1 : 0

})

return [

group(/^/Applications/(?!Utilities)/)(apps),

group(/.prefPane$/)(prefs),

group(/^/Applications/Utilities/)(apps),

group(/System/)(apps),

group(/Users/)(apps),

].map(value => {

return {

name: value.split(“/”).pop().replace(“.app”, “”),

value,

description: value,

}

})

}

let appsDb = await db(“apps”, async () => ({

Join the pack! Join 8000+ others registered users, and get chat, make groups, post updates and make friends around the world!
www.knowasiak.com/register/

Charlie Layers
WRITTEN BY

Charlie Layers

Fill your life with experiences so you always have a great story to tell