Jump to content

i386net

Member
  • Posts

    3
  • Joined

  • Last visited

Everything posted by i386net

  1. Thank you for the answer. Unfortunately, I don't know Objective-C or AppleScript. But, Is it possible to use an external script and run it through NodeJS in this case? For example: /usr/local/bin/node main.js args And is it possible to use external packages in the main.js file, e.g. axios for data acquisition? If so, how can I get the data back to Alfred?
  2. Hi! I want to test requests to remote API using JS and then get the result to clipboard. run = (input) => { const hex = input[0]; fetch(`http://thecolorapi.com/id?hex=${hex}`) .then(res => { if(res.ok) { return res.json(); } return new Error('error') }) .then(data => JSON.stringify(data.rgb.value)) .catch(err => console.log(err)); } But when I use the standard fetch() method, I immediately get the the following error: execution error: Error: ReferenceError: Can't find variable: fetch (-2700). What am I doing wrong?
×
×
  • Create New...