Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
subtitle: `标准翻译结果: ${item}`,
arg: Name(item),
});
});
// 网络翻译结果
if (Result.web) {
let WebResult = Result.web;
WebResult.map((item) => {
ResultValueArr.push({
title: Name(item.value[0]),
subtitle: `其他翻译结果:${Name(item.value[0])}`,
arg: Name(item.value[0]),
});
})
}
alfy.output(ResultValueArr);
} else {
alfy.output(ErrResult);
}
});
},
}
try {
if (alfy.cache.get('start-PID') === process.pid) {
await runApplescript(`
tell application id "com.runningwithcrayons.Alfred"
run trigger ¬
"refresh" in workflow ¬
"com.bikenik.reverso" with argument "#runref"
end tell
`)
}
if (/!.*/.test(alfy.input) || alfy.input === '') {
const out = await option(alfy.input)
alfy.output(out)
} else if (/\*.*/.test(alfy.input)) {
const fav = await favorites.fetching(alfy.input)
alfy.input = alfy.input.replace(/^\*/g, '')
alfy.output(fav)
const variantsAll = alfy.inputMatches(fav, 'title').map(x => ({
arg: x.arg
})).filter(x => x.arg)
alfy.config.set('allPhrases', variantsAll.map(x => JSON.parse(x.arg)))
} else {
const encodeInput = encodeURIComponent(alfy.input.normalize())
await searchContext.fetching(encodeInput)
}
} catch (error) {
alfy.output([await ankiInfo()])
}
})()
}).then(result => {
const data = result.data.map(pr => {
return {
uid: pr.self,
title: pr.title,
autocomplete: pr.title,
arg: pr.title
};
});
output(inputMatches(data, 'title'));
});
.then(methods => {
const items = alfy
.inputMatches(methods, 'title')
.map(method => {
return {
title: method.title,
subtitle: method.type,
autocomplete: method.title,
arg: method.url,
quicklookurl: method.url,
icon: method.icon
};
});
alfy.output(items);
});
arg: pkg.links.npm,
subtitle: 'Open the npm page instead of the GitHub repo'
},
cmd: {
subtitle: cmdSubtitle(pkg)
},
ctrl: {
arg: pkg.name,
subtitle: 'Copy package name'
}
},
quicklookurl: pkg.links.repository && `${pkg.links.repository}#readme`
};
});
alfy.output(items);
})();
.then(items => {
const output = filter(items);
alfy.output(output);
alfredNotifier();
});
const output = fs
.readdirSync(languagesDir)
.filter(lang => lang.endsWith('.js') && lang.includes(input))
.sort(comp)
.map(lang => {
lang = lang.replace('.js', '');
return {
title: lang,
subtitle: 'theme: ' + utils.theme,
arg: lang,
};
})
.sort();
alfredNotifier();
alfy.output(output);
.then(items => { alfy.output(items) })
return {
key: localName,
value: `import ${localName} from '${module}'`
}
}
return {
key: exportName,
value: `import { ${exportName} } from '${module}'`
}
}
)
const matches = alfy.inputMatches(pairs, 'key')
alfy.output(
matches.map(match => ({
title: match.key,
subtitle: match.value,
arg: match.value
}))
)
matchItems = alfy.matches(query, items, search);
matchTime = new Date();
}
debug.addTimeItem(
matchItems,
`Match Projects: ${matchTime - projectsTime}ms`
);
if (matchItems.length) {
alfy.output(matchItems);
} else {
alfy.error(`No matching project for ${query}`);
}
} else {
alfy.output(items);
}
} else {
alfy.error("No project found");
}