I don't know how to use "if statement" with either 'keydown' or 'keycode' in jxa.
I just want you to check line no.6 in the code (the second script filter)
#!/usr/bin/osascript -l JavaScript
ObjC.import('stdlib')
let events = Application("System Events")
if (events.keyDown == "s") {
Application("com.runningwithcrayons.Alfred").runTrigger("awesome", { inWorkflow: "com.alfredapp.zmes.theme", withArgument: "" })
}
function run() {
let theme_option = $.getenv('theme_option')
let post_no = $.getenv('post_no')
let sfItems = []
sfItems.push(
{ title: "Media", subtitle: "미디어", arg: "upload.php" },
{ title: "Page", subtitle: "페이지", arg: "edit.php?post_type=page" },
{ title: "CF7", subtitle: "컨택폼 7", arg: "admin.php?page=wpcf7" },
{ title: "Plugin", subtitle: "플러그인", arg: "plugins.php" },
{ title: "Theme", subtitle: "테마옵션", arg: `admin.php?page=${theme_option}` },
{ title: "Landing", subtitle: "랜딩페이지", arg: `post.php?post=${post_no}&action=edit` })
return JSON.stringify({ items: sfItems })
}